Dealing With Vista's Not-So-Secret Garbage Dump
|
Posted Saturday, 18 August 2007 by Michael Khanin
This is actually not an indictment of Vista alone, but something I've seen in Windows for quite some time now: the user profile \TEMP directory. It fills up with the most amazing amount of trash imaginable, and over time it can cause programs to malfunction left and right in ways that defy analysis.
Vista does have a way to deal with it: the Disk Cleanup tool. which purges the \TEMP directory on demand. However, as a safety measure, it doesn't delete anything newer than one week -- for instance, temporary files created as part of a program's installation process.
If you want to manually purge the \TEMP directory without the date cutoff restriction -- just blast everything in there -- here's one way to do it. Copy the following into a text file with a .BAT extension:
rd /s /q "%localappdata%\temp" && md "%localappdata%\temp"
(That's all one line, by the way.)
When run, it'll erase the entire contents of the TEMP directory and then recreate it anew.
Two caveats:
- If there are any files that are in use in the directory, they will not be deleted.
- As hinted above, do not run this command when you're in the process of installing software, such as before a reboot to finalize a program installation. It may delete components of the installer that are needed after the reboot. (Note that if you attempted to install a program and the installer failed and left garbage in the \TEMP directory, it might not be a bad idea to purge all of that before attempting to re-run the installation. Just make sure the installer is not actually running before attempting this!)
News Source: http://www.thegline.com/cgi-bin/mt/mt-tb.cgi/2628
|