Automated System Cleaning
So I do a lot of ASP.NET development on my personal system. I have bursts of going through online videos. This results in a lot of garbage showing up on my system, both in the system's Temp folder as well as the Temporary Internet folder (my primary/only browser is IE). There are guides out there to show you how to Clear IE's cache and even to clear the cache for a specific domain (i.e., site) but there are a bunch of drawbacks and concerns:
- It takes damn near forever (depending on how much junk you have accumulated)
- Does it really clear your temporary browsing cache? (after all, your browser is still open and as a general principle, you cant delete files while applications using them are open...)
- What if you use multiple browsers?
- There's no easy convenient way to empty you system's temporary folders
It's pretty easy: double-click (to launch), click (analyze) and click (clean) and click (to close) and you're done! Normally this is something I run every so often manually (i.e., during development, when I really want to wipe cookies etc or after a particularly long session of Youtubing, or 'just because'). Being the lazy old fart I am, I figured there's got to be a better way to do things with less work. Turns out there is.
A quick little investigation yielded command line parameters for CCleaner. Turns out '/AUTO' (without the quotes) runs CCleaner in the tray with the current settings and exits when finished. Brilliant! Now just make a shortcut with the auto parameter and double-click and you're done!
There are two issues still outstanding:
- It still takes damn near forever (depending on the amount of crap accumulated) and
- What about all the cookies I do want to save? (i.e., login cookies and such)
Here's how to make your life simpler and cleaner:
- Fire up Task Scheduler (taskschd.msc) .. you can find it under Administrative Tools
- On the right hand side, click 'Create Task'. A window pops up [sample]
- Setup your trigger to determine how often you want to clean your system [sample]. When you're done, it will list all your triggers [sample]
- Now setup what your want this automated event to actually do [sample]. When you're done it will list all the actions [sample]. For my system, I have the cleaning done every two hours.
- Determine the scenarios you want the cleaning to run [sample]. This will realistically only affect notebook users and those who put their system to sleep often.
- Set the various misc settings for the automated task [sample]. For my case, I have the system force-close if there is a crash/lock.
You can test the task simply by right clicking on the task in the task scheduler and selecting 'Run'. You'll see a little CCleaner icon in your system tray as it runs and it'll automagically go away when it's done it's thing. I would suggest, while you're in the Task Scheduler window, to export the task so that you dont have to do all this if you decide to format the system!
No comments:
Post a Comment