XP batch file question

M

Mary

I want to write a batch file to run on startup to clear out the local
settings/temp folder of all files except those with today's date.

So far I have compiled:

cd\
cd C:\Documents and Settings\name\local settings\temp
del /Q *.*
echo Deleting Files
echo File Deleted
pause
exit

How can I instruct it to not include files with today's date?
Does the rest look OK?

Thanks
 
D

Detlev Dreyer

Mary said:
I want to write a batch file to run on startup to clear out the local
settings/temp folder of all files except those with today's date.

That's not a good idea since this may disturb an installation process.
Instead, you may want to install a script, running at Windows startup.
http://www.helmrohr.de/ftproot/Deltemp.zip

That script checks if there is a "pending file rename operation" and if
this is the case, temporary files and subfolders will not be deleted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top