Script to delete all temp files from all user profiles?

KapsZ28

2[H]4U
Joined
May 29, 2009
Messages
2,114
I am sure you are all aware of a program called CleanUp! from Steven Gould. Well, I am looking for a way to replicate that program but it is to be used in a startup script that runs silently. I would like for it to delete all the temp files for any user account on the computer, not just the person logging in. This way we can regain some storage on older computers that a million people have used but their profiles were never cleaned up. The script should delete all files and folders within the Temp and Temporary Internet Files directory, and any other folders that are worth cleaning up that can save space and increased computer performance.

If possible, I would like the script for Windows XP and Windows 7, but Windows 7 is really more important.
 


ATF-Cleaner does what you need, just run it with admin rights if under Vista or 7
 
I am looking to use a logon or logoff script, so a program is not going to work.
 
The way you describe it, it will introduce a significant delay to the login process ( not to mention a limited user won't be able to access a different user's profile ). I suggest, instead, a two prong approach;

1) Log off script to clean up the current user's temp files
2) Scheduled task, once, to clean everyone's temp files.

I'd probably just identify which files/folders you want to delete, then write up a vbscript real quick to address it for the log off script. You can then take that script and expand upon it by adding a tree walking function for the overall clean up.
 
Back
Top