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 have a directory and sub-directory with many map documents (MXD). I need to save these MXDs to map packages to send to a client. This can be done through File/Create Map Package.

Are there any tools or scripts that will take all of these MXDs and produce map packages in batch mode, preferably in the background?

share|improve this question
up vote 7 down vote accepted

you can write your tool with Package Map (Data Management). and there is a very good example there to use.

Find and create map packages for all map documents that reside in a specified folder.

# Author: ESRI

# import system modules
import os
import arcpy

from arcpy import env

# Set environment settings
env.overwriteOutput = True
env.workspace = "C:/arcgis/ArcTutor/Editing" 

# Loop through the workspace, find all the mxds and create a map package 
  using the same name as the mxd
for mxd in arcpy.ListFiles("*.mxd"):
    print "Packaging " + mxd
    arcpy.PackageMap_management(mxd, os.path.splitext(mxd)[0] + '.mpk', "PRESERVE", 
    "CONVERT_ARCSDE", "#", "ALL")

i hope it helps you...

share|improve this answer
Thanks a lot, it help – anh.hv Jan 3 '13 at 20:42

gp's Package Map tool combined with python's os.walk

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.