Make a batch file that is scheduled (with Task Manager) to delete all the files in the directory or remove the directory every 3 days
If you need the code for the batch file - let me know
Main Topics
Browse All TopicsI need to make my own temporary folder that will auto delete after 3 days
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Is it the folder itself you want to delete or just its contents?
If you want to delete the folder itself, put this
one line into a .CMD file...
RD /S /Q %SYSTEMDRIVE%\MyTemp\
Where "MyTemp" is on the root of your Windows drive.
Then the magic bit - click Start, Accessories, System Tools, Scheduled Tasks.
Now you can choose to run that CMD file twice a week,
I am afraid it cant run every 3 days, its daily, weekly, then
under "weekly" you can set it to say "Monday and Thursday"
by ticking the days, but thats it, you cant do it "every 3 days"
unless we suddenly start having six day weeks!
Make sure you put the right username and password in to run this task.
Make sure you HAVE a password, because a blank one will not work
if you do have a blank password.
Test this out first, schedule it to delete something in ten minutes,
lots of people have problems with this "Scheduled Tasks" and its
only your XP trying to keep your system secure, EG a blank password
is not going to work. Same as logging in automatically with a blank
Admin pass is erm, well its tough but possible :)
How to automatically delete folders that are n days old?:
http://windowsxp.mvps.org/
Why would you go through the trouble of making a new schedule every time you make a new directory? The script I posted checks to see if the folder is 3 days old. It is the same thing that sramesh2k posted. You schedule the script to run daily. If the folder isn't 3 days old yet, nothing happens. It won't automatically get deleted like it would with the batch files.
Business Accounts
Answer for Membership
by: scaliouettePosted on 2006-03-13 at 12:06:00ID: 16177322
whoah, when you find out let me know!!