Select to view content in your preferred language

batch file will not run as a scheduled task

1847
1
06-30-2011 09:42 AM
StephanieSnider
Frequent Contributor
I have a batch file that executes an arcpy python script.  When I run the batch file in the DOS command line, the script works perfectly.  However, when I run the same batch file as a scheduled task, the python script runs but all of the lists are empty (which means none of the geoprocessing task run).  For example, when I do a arcpy.ListRaster(), the output is empty using the scheduled task.  When I run it in DOS, arcpy.ListRasters() contains items.   Why would the arcpy functions not run correctly in the scheduled task, but run fine in a DOS prompt?


OS: Windows Server 2003
ArcGIS Desktop 10 SP2
python 2.6
Tags (2)
0 Kudos
1 Reply
StephanieSnider
Frequent Contributor
I recreated the scheduled task, and it works fine.  I swear I tried this about 10 times earlier this week.  I think it might have had something to do with the logon for the task.  Our network folks just installed something new where they had to give user permission to run a batch file.   It seems too coincidental.  But I bet they reset something that caused the "run as a batch file" not to work until I recreated the task.  I had a similar problem this morning with the ArcGIS SOM service.  The service wouldn't start.  But when I reset the user logon (to the same user), it worked.

Go figure.  Sorry for the unnecessary post.
0 Kudos