A combo of Greg's and Darren's answer worked for me: import arcpy, os, string
rootFolder = 'C:\\test'
ctr = 1
for root, dirs, files in os.walk(rootFolder):
for name in files:
if name.endswith(".shp"):
# shapefile name without extension
shpName = os.path.splitext(name)[0]
# absolute file path
absFile = os.path.abspath(os.path.join(root,name))
# output file path
output_layer = rootFolder + '\\buffer_' + shpName + '_' + str(ctr) + '.shp'
# buffer
arcpy.Buffer_analysis(absFile, output_layer, "1 Kilometers", "FULL", "ROUND", "ALL", "")
ctr = ctr + 1
... View more