Select to view content in your preferred language

Can not access network location from Task Scheduler python

3878
2
08-06-2015 11:50 AM
forestknutsen1
MVP Regular Contributor

I have some code that runs fine when I am running it logged in. However, when I run it from task scheduler it fails. It is failing on the first line that points to a network drive.

os.listdir(path)

  • The code uses UNC paths
  • Task scheduler is set to run if the user is logged on or not
  • The task is set to run with the highest privileges
  • The run result is (0x1)
  • Bat files run from task scheduler work  fine when pointing to the network location, e.g. robocopy, RD, MD
  • Python run from a bat file works fine with the network drives

Does anyone know why this is happing?

Thanks,

Forest

0 Kudos
2 Replies
BenNadler
Esri Contributor

Are you running the task as a different user? make sure that user has access to the location.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Posting a specific error message is helpful.  There are lots of ways a Python function can fail.

0 Kudos