Clean Disk

  • Thread starter Thread starter Bill18
  • Start date Start date
B

Bill18

When I schedule a Clean Disk it does not run
automatically. I need to hit enter. How do I get the
job to run to automatically. I tried creating a .bat
file with the following C:\WINDOWS\system32
\cleanmgr.exe. How do I trigger the enter key without
pressing it.

Thanks
 
Hi

The way I use Disk Cleanup applies to all partitions - from Start>Run type the following

cleanmgr sageset:X

where X can be any number from 1 to 65535. When the Disk Cleanup screen appears, select the options you want and then click OK. Create a shortcut with the following command

cleanmgr sagerun:X

where X is the same number you used originally. You can then use this shortcut in Scheduled Tasks.
 
Thanks Will! That helps but I still have to hit enter.
I am trying to avoid pressing enter and have the process
start automagically.

Thanks
-----Original Message-----
Hi

The way I use Disk Cleanup applies to all partitions -
from Start>Run type the following
cleanmgr sageset:X

where X can be any number from 1 to 65535. When the
Disk Cleanup screen appears, select the options you want
and then click OK. Create a shortcut with the following
command
cleanmgr sagerun:X

where X is the same number you used originally. You can
then use this shortcut in Scheduled Tasks.
--

Will Denny
MS-MVP Windows - Shell/User


"Bill18" <[email protected]> wrote in
message news:[email protected]...
 
Hi

That method should enable Disk Cleanup to run automatically. Try the shortcut with the full path

%windir%\System32\cleanmgr.exe /sagerun:X - where X is the number you used originally.
 
Sorry my mistake - try this

From Start>Run type

cleanmgr /sageset:X - and then for the shortcut

cleanmgr /sagerun:X
 
Thanks! That is exactly what I am looking for.

What is the X (number)?

Do you know a shortcut for Windows update?

Thanks


-----Original Message-----
Hi

That method should enable Disk Cleanup to run
automatically. Try the shortcut with the full path
%windir%\System32\cleanmgr.exe /sagerun:X - where X is
the number you used originally.
 
Hi

I'll give you an example - from Start>Run type:

cleanmgr /sageset:1

when the Disk Cleanup screen appears you select the options that you want and then click OK. This creates a key in the Registry which relates to the number 1.

Create a shortcut with the command:

cleanmgr /sagerun:1

When this shortcut is run - either manually or via Scheduled Tasks - the corresponding number 1 is accessed in the Registry and the options that you selected for Disk Cleanup are implemented.
 
Back
Top