Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

script to stop ArcGIS Server service

$
0
0
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

Code:

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


Viewing all articles
Browse latest Browse all 2485

Trending Articles