Can Cleanup & defrag work on all drives with one click?

  • Thread starter Thread starter Old Timer
  • Start date Start date
O

Old Timer

I do video editing on my machine & have 4 hard drives installed. Is it
possible to set things up in XP so that with one click I can get Disk
Cleanup & Defrag run on all drives?
 
I am sure someone can tell you haw to set up a batch file to do that.

C:\Documents and Settings\Main>defrag /?
Usage:
defrag <volume> [-a] [-f] [-v] [-?]
volume drive letter or mount point (d: or d:\vol\mountpoint)
-a Analyze only
-f Force defragmentation even if free space is low
-v Verbose output
-? Display this help text

C:\Documents and Settings\Main>

In a file edited by notepad
call it Dfrag.bat


It might look something like this:



defrag C:

defrag d:

defrag e:

defrag f:


anyone else have any suggestions?

start run dfrag

Hemlock
 
To automate the disk cleanup process, use the following switches in a run
dialog or command prompt w/ cleanmgr.exe:

------- to create/modify a "numbered cleanup template":

/Sageset:n Enter a number between 1 and 65535 in place of n. This option
opens a dialog box that lets you select Disk Cleanup options, create a
registry key that corresponds to the number you entered, and then saves
your settings in that key. It does not run the cleanup, it only creates
"template n".

/D driveletter

specifies the drive(s) to apply the cleanup template to.

Note /D when used w/ /Sageset:n CAN specify multiple drives, but when used
w/o (ie normal interactive cleanup) only the first drive is used; it at
least allows you to make a short-cut that will bypass the "choose a drive"
dialog each time when your system has multiple volumes.

---------- to run a template:

/Sagerun:n Retrieves the saved settings for the number you enter in place
of n and then runs the Disk Cleanup utility without requiring any
interaction on your part.

----------- example:

To use these switches, follow these steps:

1) Open a Command Prompt (cmd.exe) window and type the command

cleanmgr /sageset:200 /d cde

(This number [200] is completely arbitrary; you can choose any other
number between 1 and 65535 if you prefer.) this example uses the /d switch
to perform the operation on drives c, d, and e. You can repeat this step
w/ different numbers to create different clean-up criteria (for example,
1=just temps on all drives, 2=old install files, etc)

2) In the Disk Cleanup Settings dialog box that appears, choose/check the
options you want to apply whenever you run this numbered template. Note
that there are MANY additonal options which are only available via the
/Sageset mechanism (beyond the options avail w/ the normal interactive
cleanmgr). Click OK to save your choices in the registry. This only
creates the cleanup "template", to actually run it you need to perform
step 3.

3) Create a shortcut (or type at command prompt) the command

cleanmgr /sagerun:200

to run the #200 template; subst the appropriate number. You can
double-click the shortcut to run the cleanup, or schedule it via Task
Scheduler. You can run this anytime in the future, you do not need to do
step 1+2 again unless you want to change the template's settings, or
create a new template number.
 
Back
Top