Running python script in schedule task server 2008R2

Hello,

Task to run python script to delete files from a CIFS share is being executed with following settings:

- Task running as domain admin account which has full permissions wherever needed.
- Task setting of "Run with highest proviliges" is checked.
- Task action: Program/script:  c:\scripts\python\python.exe
                       Add arguments: c:\scripts\python\script.py

the task is working just fine as long as the setting of: "Run only when user is logged on" is checked.

when changing to: "Run whether user is logged on or not" which is what I actually need and entering the correct credentials of the SAME user which is currently logged on to the server, the task does not run, and in the "Last run result" is shows: (0x1) .

the script deletes files in a mapped drive which is mapped to a CIFS share.

Any ideas ?
iNc0gAsked:
Who is Participating?
 
BlueComputeCommented:
What happens if you create another Domain Admin account and run under its credentials?

What happens if you run the job using a batch file to call python and the script?
0
 
clockwatcherCommented:
Personally, I would add some logging to the python script to figure out how far it's getting and where it's failing.  Can you post your script?
0
 
iNc0gAuthor Commented:
I eventually tried again to schedule the job using a batch file instead of directly approaching the python.exe , it worked this time as long as I used:
start c:\python27\python.exe c:\scripts\script.py  in the batch file instead of just:
c:\python27\python.exe c:\scripts\script.py

thanks for the help.
0
 
iNc0gAuthor Commented:
combo of the 2
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.