Mapped network drives do not work in scheduled tasks, unless you explicitly map them before running the task (see note 1 below). Regardless, they may still fail for a number of reasons.
If you plan to schedule a task (even calling a batch file or VBS script by command line), make sure you use the UNC network path directly, instead of the mapped drive.
For instance, instead of the mapped drive Y:\ use the UNC path \\ComputerName\Share\
Note 1: It is possible to re-map a network drive each time, when task starts, by using a custom batch script. However, using the UNC path directly is the easiest solution.
Note 2: If you are running a task as a Windows Service, under the LocalSystem account, then the service won't have access to the network at all and using UNC paths will also fail. In this case, set the service to run under the NetworkService account or another account with access to the network.
SOURCE | LINK | LANGUAGE | ENGLISH |
Very interesing post
It’s very good post.