Help2Go
Free Computer Help.
Powered by Volunteers.




Home

These forums have moved!

Click here to view the new, updated Help2Go

Automating Disk Cleanup Wizard


   Help2Go Forum Index -> Contributors
View previous topic :: View next topic  
Author Message
PartieHonteuse
Help2Go Moderator


Joined: 20 May 2003
Posts: 2845
Points: 889
Location: USA

usa.gif
Posted: Thu 03/25/2004 10:04pm [Post #1]

First of all, I'd like to say SORRY if this isn't the right place to post this. Maybe the Q&A Forum? I really didn't want to make this an Article so yeah...here goes..

This little HOW TO is for all of you that like to do a disk cleanup (start menu | programs | accessories | system tools | disk cleanup ) every so often. What this will teach you is how to do it automatically with windows 98 and higher using a batch file and the task scheduler.

First, we need to go to a command prompt:
For 98/ME : start menu | run | type "command" (no quotes) | hit "OK"
For NT/2K/XP: start menu | run | type "cmd" (no quotes) | hit "OK"

Once at the command prompt type ...
Code:

cleanmgr /sageset:5

(notice the spacing!)

Once that is finished the Disk Cleanup Wizard will open up and you select all the things you want to delete once you run the batch file. It can be anything you want. After choosing what you want to delete when it's run hit the "OK" button. Once you hit the OK button you'll be brought back to the Command prompt. Now, at the command prompt type "exit" (no quotes) to leave it.

Now, open a new notepad document and copy/paste the following code into it.

Code:

@echo off
cls
CLEANMGR /sagerun:5
GOTO EOF
:EOF
exit


Now, after copying and pasting that code into notepad click the "file" then "save as" button and name your file "cleanmgr.bat" (WITH quotes). Save it somewhere you can find it again.

Now, if you want to have this run at a scheduled time like at 5am every Monday you can use the Task Scheduler. To open the task scheduler, Start Menu | Programs | Accessories | System Tools | Scheduled Tasks (Task Scheduler). Once it opens then click the "Add Scheduled Task" or "Add Task" icon. After clicking it there will be a new window that opens asking which program you want to run. You should see a "browse" button, click it and browse to where you saved the "cleanmgr.bat" file and select it. Now click "next" and then you can choose when it should run. Now click next, if you want you can setup advanced timing options after clicking next when it asks when you want it to be run.

If you DON'T want it to run as a scheduled task and just want it available at the touch of a button, just double click the "cleanmgr.bat" file we created and it will do it automatically.

**NOTE** you can change the /sageset:5 to ANY number you want to give you multiple deleting options. I.E /sageset:5 deletes Temp Inet files and /sagset:16 deletes cookies...

Hope this is of use.

Partieā„¢[/code]
 
This post has: 1 recommendation

Back to top
Al
Advanced Guru


Joined: 27 Oct 2003
Posts: 437
Points: 175
Location: Virginia

usa.gif
Posted: Thu 03/25/2004 10:21pm [Post #2]

Partie, this is very nice! I do have one question...forgive me if it's a stupid question, but when I run the command "cleanmgr /sageset:5" the Disk Cleanup Wizard that opens is a little different than the one in the System Tools folder. Is it supposed to be that way? The one that opens from your batch file actually gives you more items to delete, but it doesn't tell you how much space your saving like the existing one does. Is it just me or is it a different Cleanup wizard? Thanks!
 
This post has: 0 recommendations

Back to top
PartieHonteuse
Help2Go Moderator


Joined: 20 May 2003
Posts: 2845
Points: 889
Location: USA

usa.gif
Posted: Thu 03/25/2004 10:48pm [Post #3]

Yeah it's different. Not sure exactly why...maybe for the automation process since it is a command line tool?
 
This post has: 0 recommendations

Back to top
Display posts from previous:   
   Help2Go Forum Index -> Contributors All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


phpBB component by Adam van Dongen. Based on phpBB © 2001, 2002 phpBB Group
Creative Commons License

(C) 2008 Help2Go      Contact Us      Joomla! is Free Software released under the GNU/GPL License.