Hi Alan: Welcome back! The latest beta 4.4.08 has some additions to file.allfiles (and listfiles) to make recursing folders only easier.
Also, I am not sure if you script will work exactly as is, as the foldervar is a local, so (if things work the way they are supposed to!) there will be a new version of this variable created when you call the routine again at the entrypoint [EMAIL PROTECTED] (You could use a static instead of a local). I hope you don't mind the following suggested change, based on your idea, and the new file.allfiles: ;------------------- ; start of script ; [EMAIL PROTECTED](?"c:\temp") [EMAIL PROTECTED](?"c:\windows\temp") [EMAIL PROTECTED](?"C:\Documents and Settings\snowman\Local Settings\Temp") quit @deleter args folder file.deletold(7,folder) file.allfiles(folder,"file.deleteold(7,_file_)",5) ; in above, 5=only folders and process all subfolders quit ;---------------------------- ;end of script > Here is a better script which will deal with more than one > temp folder. > > Copy and paste the following text into a plain text file > called deltemp.powerpro in your \powerpro\scripts\ folder. > > You can run it once per day, or per week, with a powerpro > scheduler item, using this command: .deltemp > > ;---------------------------------------------------- > > local foldervar listvar linevar > > foldervar = "c:\temp" > [EMAIL PROTECTED] > > foldervar = "c:\windows\temp" > [EMAIL PROTECTED] > > foldervar = "C:\Documents and Settings\snowman\Local Settings\Temp" > [EMAIL PROTECTED] > > quit > > > @deleter > > file.allfiles(foldervar,?"File.DeleteOld(7,_file_)",1) > > For(i=1,i<line(listvar,0),i=i+1) > linevar=line(listvar,i) > if((file.isfolder(linevar)) and (not validpath(linevar++?"\*.*")) do > file.delete(linevar) > endif > endfor > quit > > ;---------------------------------------------------- > > Note > You only need to edit the lines which say: foldervar= > > The first Quit is the end of the main script. > The second Quit is the end of a subroutine called @deleter > Attention: PowerPro's Web site has moved: http://www.ppro.org Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/power-pro/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
