import arcpy, os #workspace to search for MXDs Workspace = r"C:\Geo" arcpy.env.workspace = Workspace #list map documents in folder mxdList = arcpy.ListFiles("*.mxd") #set relative path setting for each MXD in list. for file in mxdList: #set map document to change filePath = os.path.join(Workspace, file) mxd = arcpy.mapping.MapDocument(filePath) #set relative paths property mxd.relativePaths = True #save map doucment change mxd.save()