Can I access a mapped network drive in task scheduler when user is logged off?

Wesley Price 66 Reputation points
2022-04-27T15:38:57.42+00:00

I have a python script that needs to grab files from a mapped network drive. The script works fine if I run it with the option "Run only when user is logged in", but will not run if the "Run whether user is logged in or not". It won't even work if I try to run it with the highest privileges and select to run only when the user is logged on. I get an error that says the network drive cannot be found. I am getting this error from python, but since it works fine with the other option checked I believe it has something to do with how Windows is running it.

Is it impossible to access a network drive when running a program when the user is not logged in? This is being run on Windows server 2016

Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,370 questions
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 31,571 Reputation points
    2022-04-27T17:25:23.19+00:00

    If you have configured the task to run as a user account, and you entered the user's password when prompted, then use the UNC path (\ServerName\ShareName) instead of the drive letter.

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful