Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I hesitated a bit before asking this, as it isn't necessarily a GIS specific question, though I'm using it to update geodatabases. I have found plenty of hits on a Google search, but frankly, many of the websites out there for .bat files are hacky and not real trustworthy.

Do you have a resource that you use for database manipulation through batch files?

Any GIS/Geodatabase specific resources for .bat's?

A little background, I'm just starting to dabble in batch files. I'm aware that I can automate many things that are done manually, but am terrified of doing anything I shouldn't be doing/cannot undo. I have found introductory sites that don't give much more information than printing to the console. I'm looking for something that goes into detail about databases.

share|improve this question
Nope, this is a great question. – jvangeld Mar 22 '11 at 18:08
Thanks everyone for your help. I will be looking into all of these options. – MaryBeth Mar 22 '11 at 20:41
up vote 7 down vote accepted

I don't have any specific links for you, but I think that you should look into the tools that already exist in ArcGIS Desktop.

Have you looked into using Geoprocessing tools & models via python? A good place to start would be to make your Geoprocessing model & then export the model to Python. You can get more information here:

share|improve this answer

A good place to start is the OGR toolset. This is a set of command line tools that can interact with spatial databases and could easily be formed into a batch file of commands. The ogr2ogr tool can be used to transform one dataset into another, whilst executing basic select queries or even arbitrary SQL. It acts as a single interface to lots of different types of spatial database.

Most databases have at least some support for executing SQL on the command line. For example using Postgresql you can use the psql with the -c option to execute a single command. This can be chained in a batch file with the shp2pgsql and pgsql2shp commands to load and export data.

share|improve this answer
I agree that OGR can be used well for converting data layers. I would also recommend you look into FWTOOLS which bundles the OGR tools and some other libraries into one easy to use package. I created a very basic python script & UI that you can use to call FWTools very easily from ArcGIS.… – RyanDalton Mar 22 '11 at 18:00

Here is discussion of scripts (.bat files) for ArcGIS Server on EC2.

Also, .bat files for starting/stopping arcgis services, as describe by Dave Bouwman:


net start esri_sde
net start "ESRI Image Server"
net start "ESRIImageServerReporter"
net start "ESRI Image ServiceProvider: 3983"
net start ArcServerObjectManager


net stop ArcServerObjectManager
net stop esri_sde
net stop "ESRIImageServerReporter"
net stop "ESRI Image ServiceProvider: 3983"
net stop "ESRI Image Server"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.