Introduction
In this article, we will discuss how to create and configure a Task Scheduler task in Windows 10/11 to mount a shared drive automatically upon logon. This can be particularly useful for users who need access to specific network resources as soon as they log in to their system.
Prerequisites
Before we begin, ensure the following:
- The shared drive is accessible on the network.
- You have the necessary permissions to mount the shared drive.
- Windows Firewall is configured to allow network access to the shared drive.
Creating the Task Scheduler Task
Follow these steps to create a Task Scheduler task:
- Press Win + R to open the Run dialog box, type
taskschd.mscand press Enter to open the Task Scheduler. - Click on Create Basic Task under Actions in the right pane.
- Name the task, for example,
MountSharedDrive, and provide a description if desired. - Under When the task is created or when the computer starts, select At log on.
- Under Actions, click on Add an action and select
Start a program. - In the
Program/scriptfield, enter the path to the command-line utilitynet.exefollowed by the/useoption and the UNC path of the shared drive, for example,"C:\Windows\System32 et.exe" /use:\\server\share. - Click OK to save the task.
Testing the Task Scheduler Task
To test the task:
- Restart your computer.
- Log in to your account.
- Check if the shared drive is mounted by opening File Explorer and looking for the network location in the Network section.
Troubleshooting
If the shared drive does not mount automatically:
- Check the Task Scheduler task status by opening the Task Scheduler and looking for the
MountSharedDrivetask under Task Scheduler Library. - Right-click on the task and select Run to manually run the task.
- If the task fails, check the Event Viewer for any related errors.
- Make sure the shared drive is accessible on the network and that you have the necessary permissions to mount it.
References
For more information: