Home arrow GIS Data & Resources arrow Scripts and Code arrow C# Code arrow ArcGIS Server - Batch Stop and Start Services
ArcGIS Server - Batch Stop and Start Services PDF Print E-mail

Written by Steve Gourley,

This executable from ESRI, although not supported, works well at stopping and starting your ArcGIS services. This works for all services including globe, geocode, geoprocessing and map services.

 

Included in this zip archive are the arcgisservice.exe and the instruction.txt file. This exe can be used through the command line like the example given in the instructions

C:\> arcgisservice [serverName] [serviceName] [serviceType] [stop | start]
Example: Stop the MapService called "myService". Note: The executable is case-sensitive.
C:\> arcgisservice myServer myService MapServer stop

or more realistically it can be run as a scheduled task using batch (.bat) files.  Follow this link for a good picture tutorial of how to schedule tasks.

To accomplish this, you need to have the arcgisservice.exe in the same directory as your batch file or reference the path on disk in the batch file to the exe. 

The example below starts a mapserver from a batch file with the exe in the same directory. 

arcgisservice     192.168.0.1    myMapService    MapServer     stop
arcgisservice     192.168.0.1    myMapService    MapServer     start

This will stop and start your service bringing the number of instances back down to the default level.  One may have thought the recycling interval property would have done this also but that is not the case.

If you wanted to log your batch file progress you can write to an existing text file with the syntax below

@ECHO ON
echo ------------------------------------------ >> C:\Scheduled\log.txt
echo stopping service at %TIME% - %DATE% >> C:\Scheduled\log.txt

 


Users' Comments  
 

Display 1 of 1 comments

1. Mon, 10-05-2009 at 12:17 PM

I can succesfully start and stop services that are in the root folder using the syntax in the read me file. However I can not get it to work on services that are in Folders under the root directory. Is there a trick to doing this or special syntax??

Display 1 of 1 comments

Add your comment

27, Mar. 2008
Last Updated ( 18, Feb. 2009 )
 
< Prev   Next >

AGRC Contacts | UGIC Contacts

feed image feed image

Utah GIS Portal © 2009 AGRC

Optimized for