2

I have a Python script that I want to run on a machine running Windows Server 2012 (in a domain environment), once a day. It copies files from one network drive to another, and logs its results to a local folder.

The drives are referenced in the script using UNC, not mapped drive letters (like Z:). The account that is running the task has access to both network locations. And when I run the script from the command line, or when I set the task to "Only run when the user is logged in", the script works perfectly, and copies the files over correctly.

However, when I save these same credentials so that the task can be "Run whether the user is logged in or not", it still runs the script, but Python throws an error - access to the network location is denied. The logging still works, and the Python script manages to write to the local folder just fine. However, the program cannot read from or write to the network drive.

How can I set up task scheduler so that the Python script will have the same level of access even when I have it set to run whether the user is logged in or not?

0

You must log in to answer this question.