Copy and paste into Python file, update the directory variable in the code and run. All aux will be removed in the folder and subFolders.
#smjRemoveStatisticsFromFileImagery.py
#Purpose:
#Remove image statistics from file-based imagert
#import Modules
import string, os, datetime, sys
#banner
print "***\nRemove Image Statistics from Directory and Subdirectories\n***"
#input Parameters
#USER NEEDS TO PROVIDE A DIRECTORY VALUE
directory=r"D:\Temp" #r"c:\temp"
#walk
print "processing" + directory
startTime=datetime.datetime.now()
#walk Through The Subdirectories
print "***Walk:\t" + directory
for src, dirs, files in os.walk(directory):
#process Each Directory
wsp=os.path.join(directory, src)
print "***processing:"+src
#get Files
try:
fls=os.listdir(src)
for fl in fls:
#check If Aux File
if string.find(string.lower(fl),".aux") > -1:
try:
os.remove(os.path.join(wsp,fl))
except:
print "cannot Process " + os.path.join(wsp,fl)
except:
print "cannot Process " + wsp
#print Elapsed Time
print "Elapsed Time:" + str(datetime.datetime.now()-startTime)
#complete
print "complete"