question

WesleyPrice-5347 avatar image
0 Votes"
WesleyPrice-5347 asked WesleyPrice-5347 commented

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MotoX80 avatar image
1 Vote"
MotoX80 answered WesleyPrice-5347 commented

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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Worked perfectly, and I feel a little stupid I didn't think of that.

Thank you!

0 Votes 0 ·