Delete your TEMP files on shutdown
It is really easy to set Windows XP to delete the contents of your Temp folder (or run any other commands) on shutdown. There are numerous reasons why you might want to delete your Temporary files when you shutdown Windows XP. Your Temporary files folder can get extremely large. Take a look at what is in C:\WINDOWS\Temp.
The first step is to install Xecutor. You can download Xecutor from the Xpertdesign homepage.
The second step is to create a batch file that will delete your temporary files on shutdown. To do this open up notepad and type the following line:
del /Q G:\WINDOWS\Temp save your file as tempdelete.bat. Alternatively, you can download my tempdelete.bat file if you prefer.
The third step is to configure Xecutor to run the tempdelete.bat file on shutdown. Open Xecutor, and answer no to the stream of questions
it prompts you with the first time you run it. Next choose the shutdown tab and add tempdelete.bat file. This is shown below:
After you hit OK you will now see tempdelete.bat in the shutdown tab of Xecutor.
Now just close Xecutor and it will run in your system tray. The last step is to drag the Xecutor icon from your desktop into your Startup folder located in Start >> All Programs >> Startup so that Xecutor starts when you start Windows.
You are all set, now when you shutdown Windows, your temporary files will be deleted, as well. You can add other commands the same way (i.e., delete cookies, delete My Documents, etc.).
What other commands do you think would be useful to run at Shutdown? Let us know in the comments.
Tags:Windows, windows vista, windows xp
























January 30th, 2007 at 6:35 pm
you shutdown Windows XP. Your Temporary files folder can get extremely large. Take a look at what’s in C:\WINDOWS\Temp. The first step is to install Xecutor. You can download Xecutor from the Xpertdesign homepage. The second step is to create a batch file that will delete your temporary files on shutdown. To do this open up notepad and type the following line: del /Q G:\WINDOWS\Temp save your file as tempdelete.bat. Alternatively, you can download my tempdelete.bat file if you prefer.
May 25th, 2007 at 1:19 am
thanks i’ve been look for this trick for quite sometime now.
July 25th, 2007 at 12:56 am
[...] Your page is on StumbleUpon [...]
August 9th, 2007 at 2:55 pm
[...] online community for creating, buying and selling artVideo of the Week: Octopus Vs SharkGeek Tip: Delete your temp files on shutdown - PC Tips Box provides this great tip for Windows XP users. From the article: “It is really easy to [...]
August 27th, 2007 at 5:10 pm
[...] Delete your TEMP files on shutdown [...]
August 30th, 2007 at 10:43 am
[...] Delete your TEMP files on shutdown [...]
October 13th, 2007 at 6:40 pm
Interesting info, but a bit dated. It is true that there is a %windir%\temp directory and it is used but the big directoy to be deleted is the %userprofile%\local settings\temp and %userprofile%\local settings\temporary internet files\. These directories get filled up very fast. There also is the history files also under the same tree and a userdata directory that has several nonsensical directories that can be deleted. Create a batch file for any you want to delete and make sure you use the del /s /f /q to not only delete without prompting, but also grab any subdirectories and force the deletion of any read only files. Remember, this is a temporary directory so there should be nothing in there that needs to be kept after a reboot. I would also redirect the output to a log directory so you can make sure files are being deleted. Use the >> logfile.txt at the end of the batch file command string and replace logfile.txt with whatever you want to call your log.
But the main thing is, why download another third part tool to execute the batch file? Simply do this: Start > Run > gpedit.msc. Look under Windows Settings > Scripts (Startup/Shutdown). Double click on Shutdown and browse for your batch file(s). Every time you (gracefully) shutdown Windows, all scripts will be executed via Group Policy. Group Policy is very powerful and useful in managing Windows.