imgooch

script to stop ArcGIS Server service

Discussion created by imgooch on Feb 11, 2013
Latest reply on Feb 12, 2013 by imgooch
I've used the following script to start/stop the AGS windows service, standalone and in models, so I can do some data management with very little downtime.  This script worked find in 10.0 but doesn't work in 10.1 now.  The name of the windows service changed and is reflected in the script but it does not start/stop the service as expected.  I can't seem to find out what changed in 10.1 that made this not work, nor can I find any alternative that makes any sense to me.  I need it to be a script without any prompts.  I've seen posts about stopping individual services but I don't see the need to do that when I can stop it all through the windows service instead...and much faster....plus all those scripts prompted for service name.   Anyone know what is wrong with this code now?

Thanks

import os
import arcpy
os.system('sc \\\\MachineName stop "ArcGIS Server"')

Outcomes