I have parent directory containing subfolders with layer files (.lyr) and I want to list Feature Classes, Geometry Types, server and user names for these files. Also I need Python to scan these files recursively. I am only a beginner in Python, so I don't really know how to do it. All I've done so far is here:
import os, fnmatch import arcpy for dirpath, dirnames, filenames in os.walk("F:\\"): for filename in filenames: if fnmatch.fnmatch(filename, "*.lyr"): lyr_filename = os.path.join(dirpath,filename) layers = arcpy.mapping.MapDocument(lyr_filename) for layer in arcpy.mapping.ListLayers(layers): print(lyr_filename,layer.serviceProperties)
This code scan all the files in the subfolders, but it does not print the information I need. Version of my ArcCatalog is 10.0.