import arcpy from arcpy import env def loadAllShapefiles(path): # set workspace path to the one we will be searching SHPs in env.workspace = path # get a list of all SHPs in the folder fcList = arcpy.ListFeatureClasses() print fcList # sets mxd to the currently opened document mxd = arcpy.mapping.MapDocument("CURRENT") # sets df to the first data frame df = arcpy.mapping.ListDataFrames(mxd, '')[0] # iterates over every SHP name in the folder for fc in fcList: # get the whole path to the SHP pathToFC = env.workspace + "/" + fc # create a new layer from the SHP newLayer = arcpy.mapping.Layer(pathToFC) # add the new layer to the bottom of the data frame arcpy.mapping.AddLayer(df,newLayer,"BOTTOM") # refresh Table of contents and the active view (so the layers appear immediately when the script finished) arcpy.RefreshTOC() arcpy.RefreshActiveView()