Link to home
Start Free TrialLog in
Avatar of mystics7
mystics7Flag for United States of America

asked on

VBS to delete file time in folder and sub folders

I'm looking to have a scheduled task that runs a VBS script (called from a bat file) that deletes PDF Files is a folder and it's sub folders. Thank you in advance for your help!!!!!
Avatar of rettiseert
rettiseert

If you are using a bat file why not to use a simple shell command? try this in the bat:

DEL C:\your_folder\*.pdf /S /Q /F
Avatar of mystics7

ASKER

this will also delete the pdfs from the sub folders?
I also forgot to mention that this has to be done one files older than 30 days
Avatar of Bill Prew
Why not just use this handy little free utility called DELAGE32

http://home.mnet-online.de/horst.muc/win/delage.htm
http://home.mnet-online.de/horst.muc/wbat32.htm

So a simple command like the following could do it for you:

delage32 c:\temp\*.pdf 31 /recurse

~bp
ASKER CERTIFIED SOLUTION
Avatar of mystics7
mystics7
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial