cleanmgr command line switches

When I run cleanmgr /? at the command prompt (as administrator) I get the following dialogue box...

USAGE
cleanmgr [/SAGESET:n | /SAGERUN:n | TUNEUP:n | /LOWDISK | /VERYLOWDISK | /SETUP]

I found microsoft documentation on the SAGESET and SAGERUN switches.
http://support.microsoft.com/default.aspx/kb/253597

What do the other switches do?

Thanks.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

More

http://support.microsoft.com/kb/315246
Rob - Supporting Member, Cascade Bicycle Club P.O. Box 15165 Seattle, WA. 98115-0165 206-522-3222 and 24 hr hotline 206-522-BIKE http://www.cascade.org  
Rob Brown - Microsoft MVP - Windows Insider MVP 2016 - current
Windows and Devices for IT 2009 - 2020

3 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

In the absents of any clear information on those switches if you care to run them you will see what they do.  They basically offer various cleaning options and differing output results.  I tried them on my machine and nothing untoward happened but I think I now have a very clean hard drive, and I'm still able to type this message afterward too.


C:\Windows\system32>cleanmgr /tuneup:1

C:\Windows\system32>cleanmgr /verylowdisk

C:\Windows\system32>cleanmgr /setup

C:\Windows\system32>cleanmgr /lowdisk

C:\Windows\system32>cleanmgr /SAGESET:1

C:\Windows\system32>cleanmgr /SAGERUN:1

5 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

This does not answer anything. 4 years after the launch of Vista, there is still no documentation about these new switches in Vista/7? This is pathetic. I want to programatically clear the Windows.old folder (known as Previous Windows Installation). How am I supposed to know this if there is no documentation? C'mon Microsoft.

3 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

How to use the Disk Cleanup feature to delete the Windows.old folder after you install Windows Vista
http://support.microsoft.com/kb/930527

1 person was helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

CLEANMGR.exe

Automated cleanup of Temp files, Internet files, downloaded files, recycle bin.

Syntax
     CLEANMGR option

Options
       /d driveletter: Select the drive that you want Disk Cleanup to clean.

       /sageset:n      Display the Disk Cleanup Settings dialog box and create
                       a registry key to store the settings you select.
                       The n value is stored in the registry and allows you to
                       specify different tasks for Disk Cleanup to run.
                       n can be any integer from 0 to 65535.
                       Specify the %systemroot% drive to see all the available options.

      /sagerun:n       Run task 'n'
                       All drives in the computer will be enumerated, and the
                       selected profile will be run against each drive. 

    Only one of the 3 options above can be run at a time

      /TUNEUP:n        Run sageset + sagerun for the same n

      /LOWDISK         Run with the default settings.

      /VERYLOWDISK     Run with the default settings, no user prompts.

      /SETUP           Undocumented
      /Help            Undocumented
      /Usage           Undocumented
      /?               Display help

To enable Cleanmgr on Windows 2008, open Server Manager and choose Add feature, then select "Desktop Experience"
After running cleanmgr on a server you will probably want to disable "Desktop Experience" again (or use this script.)
When necessary cleanmgr may take ownership of the files before deleting them.

Registry settings for CLEANMGR are held in:
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches]

Examples

CLEANMGR /sageset:64

CLEANMGR /sagerun:64

Options that can be chosen for cleanup:

Temporary Internet Files
Temporary Setup Files
Downloaded Program Files
Old Chkdsk Files
Recycle Bin
Temporary Files
Temporary Offline Files
Offline Files
Compress Old Files
Catalog Files for the Content Indexer
System files: Debug/chkdsk/Installer/Memory dump/Windows update/error reporting logs.

Items in bold may appear in more than one drive i.e not just in %SystemRoot%

Application Data

Many files in Application Data hold system data that should not be deleted, however some applications do leave files which you may want to delete from a roaming profile, these can be selectively removed with a VBScript like this.

Recent files

The 'User Profile/Recent' folder (for Start, Documents) may contain many more shortcuts than are set to display in the GUI. A very large number of these can affect logon/logoff times.
To clear out the shortcuts:

cd %userprofile%\Recent
echo y| del *.*

Close Locked files by restarting Windows Explorer

Close all applications
Open a command prompt
Type:
taskkill /im explorer
This should kill explorer and bring up a logout/shutdown dialogue box.
Simultaneously press CTRL+SHIFT+ALT.
While you keep these keys pressed, click [Cancel] in the Shut Down Windows dialog box.
In the command prompt window, you should now be able to delete the locked files.
At the command prompt, type explorer, and press ENTER to restart Windows Explorer.


Related:

DELPROF - Delete user profiles and/or User Profile cache
DEFRAG - Defragment hard drive (XP)
Q253597 - Automating Disk Cleanup in Windows
Q315246 - Automating Disk Cleanup in Windows XP
Q812248 - Disk Cleanup stops responding while compressing old files
Equivalent bash command (Linux): watch - Execute/display a program periodically

5 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

They aren't new and are documented.

Win 98 Resource Kit

This utility also appears when a user is running out of hard disk space. If Windows attempts to allocate space on a hard drive (create a file or resize an existing file) and the free disk space drops below a set threshold, a low disk space notification will appear. This notification prompts the user to run Disk Cleanup. The threshold is 25–65 MB, depending on the volume size. The low disk space warning only appears once during a Windows session. The user will see a second warning only when they completely run out of disk space. The out of disk space warning will always appear when Windows attempts to allocate space on a drive that is completely full.

Windows SDK Shell Docs.

Disk cleanup can be initiated in three ways:

  • The user can initiate disk cleanup by clicking Start; pointing to Program Files, Accessories, and System Tools; and then clicking Disk Cleanup.
  • The system notifies the user with a message box that unused disk space has reached critical mode. The threshold for critical mode depends on the size of the disk drive, but it is typically reached when unused disk space falls below 25-50 MB. The user is given the option of cleaning the disk manually or starting the Disk Cleanup utility.
  • The user can have the Windows Maintenance Wizard run the Disk Cleanup utility automatically at scheduled times.

2 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

AsI said Disk Cleanup are individual programs. There is a general purpose cleaner that behaviour can be specified by registry entries, and it's the basis of all the ordinary file and folder cleaners.

 

You can create your own cleaners by creating registry entries.

 

Here's a post I made 8 years ago. Need to read whole page.

 

http://us.generation-nt.com/answer/customization-disk-cleanup-help-93296622.html

 

You can extend the inbuilt cleaner.

Here's one I just made that does *.fred in c:\desktop if more than 2 days since last accessed.
Merge the file then look here in the registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\CustomDeleter
and alter the path and filetype (I didn't want to delete my hard drive by mistake as 98 disk cleanup threatened to do if you customised parameters). Also as the path is an Expand type it's in hex in the regfile and in english in the reg (because regfiles don't support expand so it uses hex). If using environmental variables the data type must be expand.

I created a file called New Text Document.Fred, set my clock forward, and it deleted. It didn't delete unless I set the clock forward so it shows the time is working (note it is last access not modified or created).

To use
cleanmgr /sageset:<a number>
and only tick the Customer Deleter
This sets it up

Then to run or schedule
cleanmgr /sagerun:<same number used above>

You can have as many pairs of sageset/run as you want.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\CustomDeleter]
@="{C0E13E61-0CC6-11d1-BBB6-0060978B2AE6}"
"FileList"="*.fred"
"Folder"=hex(2):63,00,3a,00,5c,00,64,00,65,00,73,00,6b,00,74,00,6f,00,70,00,00,\
00
"Flags"=dword:00000000
"LastAccess"=dword:00000002
"StateFlags"=dword:00000001
"Display"="Custom"
"Description"="Clears a custom folder"

To make multiple cleaners just change the last key name (CustomDeleter)

Seperate multiple filetypes like so (pipe)
*.fred|*.horse

Seperate multiple directories the same way.
c:\desktop|C:\games

Use this syntax for directories ?:ecycled

Which will do all drives or the specified drive (depending on how cleanup is being used)

Last Access can be set to 0 for instant deleting.

AFAIK Disk Cleanup won't delete user data only IE's cache. There is more there than IE's cache.

 

Here are the flags if you are interested.
Flags

REG_DWORD or REG_BINARYFlags controlling elements of the search and cleaning procedure. One or more of the following values. Flag Value Meaning
DDEVCF_DOSUBDIRS0x00000001Search and remove recursively.
DDEVCF_REMOVEAFTERCLEAN0x00000002After the handler is run once, remove it from the registry.
DDEVCF_REMOVEREADONLY0x00000004Remove files that meet the search criteria even if they are read-only.
DDEVCF_REMOVESYSTEM0x00000008Remove files that meet the search criteria even if they are system files.
DDEVCF_REMOVEHIDDEN0x00000010Remove files that meet the search criteria even if they are hidden files.
DDEVCF_DONTSHOWIFZERO0x00000020Do not display this handler in the disk cleanup manager if no files match its search criteria.
DDEVCF_REMOVEDIRS0x00000040Match the FileList value against directories and remove matches and all of their subdirectories.
DDEVCF_RUNIFOUTOFDISKSPACE0x00000080Run this handler only if available disk space has fallen below the critical value, determined by the disk cleanup manager setting the EVCF_OUTOFDISKSPACE flag through IEmptyVolumeCache::Initialize or IEmptyVolumeCache2::InitializeEx.
DDEVCF_REMOVEPARENTDIR0x00000100Remove the parent directory of the specified files once the cleaner has run.
DDEVCF_PRIVATE_LASTACCESS0x10000000Use the LastAccess value, if provided, in ascertaining which files should be cleaned. This flag is ignored when using the DataDrivenCleaner—any provided LastAccess value is always used.

.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Freeing up Disk Space
Last Updated 18-1-2014
 

Contents

 

  • To see how much space you have used and free
  • To see where files are taking up space
  • Disk Cleanup
  • System Restore
  • Repair the Recycle Bin
  • Repair Temporary Internet Files
  • Delete Files in the System and Service Profiles Temp Folder
  • Check Size of Swap File
  • Turn Off Hibernation
  • Compact the Various Databases Windows Uses
  • Remove files updated by Service Packs
  • Relocate Your Documents
  • Delete Backed Up Files Made By Photo Gallery
  • Extending The Size of the Drive
  • Compress Files
  • Turn off Low Disk Space Warnings
  • Supercharging Disk Cleanup
 

 

To see how much space you have used and free

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

For the system drive

 

wmic volume where (DriveLetter='%systemdrive%') get Caption, Capacity, freespace /format:list

 

For all drives

 

wmic volume get Caption, Capacity, freespace /format:table

 

If you want to store this info on your desktop

 

wmic /append:"%userprofile%\desktop\Free Disk Space Report.html" volume get Caption, Capacity, freespace /format:htable

 

To open double click Free Disk Space Report.html on your desktop or type

 

start "" "%userprofile%\desktop\Free Disk Space Report.html"

 

Then come back here after cleaning and repeat these commands to see the difference.

 

If for some reason the wmic command doesn't work use these two commands. Both take a long time.

 

defrag %systemdrive% -a

 

or

 

dir %systemdrive%\*.* /a /s

 
To see where files are taking up space
 
This will list the number of files and size for folders on your drive. Each command does a subset so you can manage it better.
 
 
Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).
 
 
Then configure the command prompt. Right click the Command Prompt's titlebar - Properties - Layout tab - and enter 1000 for Screen Buffer Size Height and 43 (or 50) for Window Size Height. Change the Color (Color tab) and Font (Font tab) if you want.
 
To see size of folders in Documents, excluding music, video, or pictures folders.
 
for /f "skip=2 tokens=3" %A in ('Reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal"') do set doc=%A
 
for /f "usebackq tokens=2* delims= " %i IN (`dir "%doc%" /a /s ^|findstr /i /v "\/"^|findstr /l /v "Pictures Music Video"`) DO @echo %j&echo.
 
To see size of folders in Music.
 
for /f "skip=2 tokens=4" %A in ('Reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Music"') do set Doc=%A
 
for /f "usebackq tokens=2* delims= " %i IN (`dir "%doc%" /a /s ^|findstr /i /v "\/"`) DO @echo %j&echo.
 
To see size of folders in Pictures.
 
for /f "skip=2 tokens=4" %A in ('Reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Pictures"') do set Doc=%A
 
for /f "usebackq tokens=2* delims= " %i IN (`dir "%doc%" /a /s ^|findstr /i /v "\/"`) DO @echo %j&echo.
 
To see size of folders in Video.
 
for /f "skip=2 tokens=4" %A in ('Reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Video"') do set Doc=%A
 
for /f "usebackq tokens=2* delims= " %i IN (`dir "%doc%" /a /s ^|findstr /i /v "\/"`) DO @echo %j&echo.
 
To see size of folders on the Desktop.
 
for /f "skip=2 tokens=3" %A in ('Reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Desktop"') do set doc=%A
 
for /f "usebackq tokens=2* delims= " %i IN (`dir "%doc%" /a /s ^|findstr /i /v "\/"`) DO @echo %j&echo.
 
To see size of folders the Windows folder.
 
for /f "usebackq tokens=2* delims= " %i IN (`dir "%windir%" /a /s ^|findstr /i /v "\/"`) DO @echo %j&echo.
 
To see size of folders the Program Files folder.
 
for /f "usebackq tokens=2* delims= " %i IN (`dir "%ProgramFiles%" /a /s ^|findstr /i /v "\/"`) DO @echo %j&echo.
 
 
Disk Cleanup

 

The normal way to run Disk Cleanup is to right click the drive in My Computer (Start menu - Computer), then Properties - General tab - Disk Cleanup button.
 
 
Another way is Start menu - All Programs - Accessories - System Tools - Disk Cleanup.
 
Disk Cleanup can be started from the command line.
 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 
To do your main drive.
 
cleanmgr %systemdrive%
 
To choose which drive to do.
 
cleanmgr
 
See the last section of this note to see how to supercharge Disk Cleanup.
 System Restore

 

 

In Disk Cleanup above also see the More Options tab. You can delete all but the last System Restore point and see if that is taking up space.

 

System Restore uses 15% of the disk space normally. To change click Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type Regedit and navigate to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore\cfg

and double click DiskPercent and click Decimal and change the value to the percentage you want,

 

You can change it at the command prompt.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

To see size of System Restore folder.

 

You don't normally have access to this folder. You need to take ownership, give administrators permission, then query the size.

 

takeown /f "%systemdrive%\System Volume Information" /a /r /d y
icacls "%systemdrive%\System Volume Information" /grant Administrators:f /t /c /q
dir "%systemdrive%\System Volume Information" /a /s

 

To see current percentage

 

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore\cfg" /v DiskPercent

 

It's hexadecimal. Numbers are 0-9 then a-f. So 0xf is 15. 0x5 is 5, 0x9 is 9, 0xa is 10, 0x14 is 20.

 

To set to a different value.

 

You can use decimal values to set it. This sets it to 10% (bolded in the example and the last item on the line).

 

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore\cfg" /v DiskPercent /t REG_DWORD /f /d 10
 
To repair the System Restore folder delete it and restart System Restore.
  
sc stop vss
takeown /f "%systemdrive%\System Volume Information" /a /r /d y
icacls "%systemdrive%\System Volume Information" /grant Administrators:f /t /c /q
rd "%systemdrive%\System Volume Information" /q /s
sc start vss

 

Repair the Recycle Bin

 

Sometimes files get lost in the recycle bin. Delete the storage folders. It will be automatically recreated next time you delete a file or open the Recycle Bin. It will delete the Recycle Bin, and files it contains, for all users.

 

Empty the recycle bin.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

To see the size of files in the recycle bin

 

It should have one or no files in it if working. There should be a dir (folder) per user.

 

dir %systemdrive%\$RECYCLE.BIN\*.* /a /s

 

To reset the recycle bin

 

rd %systemdrive%\$RECYCLE.BIN /s /q

Repair Temporary Internet Files

 

Sometimes files get lost in the temporary internet files folder. Delete the files. It will be automatically recreated next time you download it. It will delete for the current user only.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

To see the size of files an empty temporary internet files folder

 

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

 

dir "%userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*" "%userprofile%\AppData\Local\Microsoft\Internet Explorer\DOMStore\*.*" /a /s

 

Then to delete.

 

Close Internet Explorer and Explorer first. Some files may not delete at this time, they will be able to be deleted later.

 

del "%userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files" /s /q

 

also the DOM store, similar to TIF.

 

del "%userprofile%\AppData\Local\Microsoft\Internet Explorer\DOMStore" /s /q

 

Then to see the new size.

 

dir "%userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*" "%userprofile%\AppData\Local\Microsoft\Internet Explorer\DOMStore\*.*" /a /s

 
To see the size of the cache type the following
 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 
Reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\Content" /v CacheLimit
Use calculator to convert from hex to decimal. Start Calculator (Start - All Programs - Accessories - Calculator) and choose View menu - Scientific, then View menu - Hex. Enter the value returned aboveThen View menu -  Decimal. To convert to windows units divide by 1024 for kilobytes, divide again by 1024 for Megabytes.
 
Set between 50 MB and 250 MB. You can use decimal here. The unit is in kilobytes. The below is 250 megabytes (250,000 x 1024 bytes)
 
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\Content" /v CacheLimit /t Reg_DWord /d 250000 /f
  

Delete Files in the System and Service Profiles Temp Folder

 

The system temp folder is only used when noone is logged in. It is rarely used but never cleaned. Certain services have their own temp folder that is also not cleaned.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

To list

 

dir c:\windows\temp C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp /a /s

 

To delete

 

del  C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\*.* C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\*.* c:\windows\temp\*.* /s /f /q

Check Size of Swap File

  

 

As a general rule you want your swap file a little bigger than the amount of memory you have. It grows automatically but doesn't shrink automatically. If using memory hungery programs like video editing it should be bigger. If too big you can shrink it and if pressed for space can be moved to another drive.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

To see what your usage has been

 

wmic pagefile get /format:list

 

To see the file size on disk

 

dir c:\pagefile.sys /a

 

To change size or change drive see Change the size of virtual memory in Start - Help and Support.

 

Turn Off Hibernation

 

The hiberation file is the same size of installed memory. If not hibernating the computer turn it off and save plenty of disk space.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

To see if it's on

 

If on the file will be found. If off the file won't be there.

 

dir %systemdrive%\hiberfil.sys /a

 

To turn off

 

powercfg -h off

 

To turn back on again

 

powercfg -h on

 

Compact the Various Databases Windows Uses

 

You can compact the various databases Windows uses. These are Windows Update, Windows Search, Security Certificates, Windows Mail, Windows Contacts, Windows Calandar, some Windows Live apps, and Internet Explorer ver 10.

 

Close Windows Mail and Internet Explorer. Wait a minute for Internet Explorer to release it's file locks.

 

To see how much space it taking up type what's below and note the total size (because it will scroll away).

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

dir c:\*.edb c:\*.msmessagestore c:\WebCacheV*.dat c:\catdb /a /s

 

Then to compact

 

sc stop wuauserv
sc stop bits
sc stop wsearch
sc stop cryptsvc
for /r c:\ %A in (*.edb *.msmessagestore WebCacheV*.dat catdb*.) do esentutl.exe /p "%A" /o
for /r c:\ %A in (*.edb *.msmessagestore WebCacheV*.dat catdb*.) do esentutl.exe /d "%A"
sc start cryptsvc
sc start wsearch
sc start bits
sc start wuauserv

 

Then to delete some temporary files.

 

del c:\*.integ.raw c:\TEMPDFRG*.edb /s

 

Then to see the new size and compare to the old size

 

dir c:\*.edb c:\*.msmessagestore c:\WebCacheV*.dat c:\catdb /a /s

 

If a program has a file open you can use this procedure to find which program.

 

openfiles /local on

 

Reboot

 

openfiles /query /v|findstr /i "WebCacheV[0-9]*\.dat \.edb \.msmessagestore catdb"

 

 

Remove files updated by Service Packs

 

To see how much space it taking up type what's below and note the total size (because it will scroll away). Also note that the total is higher than it actually is.

 

This will remove the ability to uninstall the service packs.

 

Depending on the service pack Windows was supplied with you may have both, one, or neither of these two files.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

dir c:\Windows\WinSxS /a /s

 

Then type

 

VSP1CLN.exe
COMPCLN.exe

 

Then to see the new size and compare to the old size

 
dir c:\windows\WinSxS /a /s

 

Relocate Your Documents

 

If you have another drive you can move the documents folder to it.

 

Right click your Documents (or Pictures, Videos, Contacts, Desktop, etc) folder - Properties - Location tab - Move.

 

Delete The Thumbnail and Icon Caches

 

These files may contain thumbnails or icons of long ago deleted files. The files will be recreated as needed.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste). The desktop and Start menu will briefly disappear.

 

To see size

 

dir "%userprofile%\AppData\Local\*.db" "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*.db" /a

 

then to delete

 

taskkill /im explorer.exe /f
attrib -r -s -h "%userprofile%\AppData\Local\*.db"
attrib -r -s -h "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*.db"
del "%userprofile%\AppData\Local\*.db"
del "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*.db"
explorer

 

to check the new size

 

dir "%userprofile%\AppData\Local\*.db" "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*.db" /a

 

Delete Backed Up Files Made By Photo Gallery

 

Windows Photo Gallery makes a copy of any file you change. Click Start - All Programs - Accessories - Run (or press Winkey + R). Type

 

Shell:original images

 

Delete ones you don't want.

 

Extending The Size of the Drive

 

If all the space on the disk hasn't all been used it may be possible to extend your drive.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

diskpart

 

then type

 

select volume c:

 

Then type to see size

 

list volume

 

then (it will work if possible or won't if not possible)

 

extend

 

then type to see the new size

 

list volume

 

then to exit type

 

exit

 

If you want advice on extending the partition type the following and paste back the output

 

diskpart

list disk

list volume

select disk 0

list partition

select disk 1

list partition

exit

 

To copy the text output right click the window - Mark then select the text and press Enter.
 

 

Compress Files

 

There are two ways to compress files in windows. Zip files and the inbuilt file compression. This is about the inbuilt file compression. Type zip in Start - Help and Support for more info on zipping.

 

Photos, music, and video are already compressed. They may get larger if Windows tries to compress them any further. Also usually a bad idea to compress system files.

 

If you have document or spreadsheet files they can be compressed very well. If you have folders of setup files they may also be good candidates. Web  pages also make good candidates.

 

In Windows Explorer blue filenames means Compressed (this is file system compression not Compressed folders aka zip files). Green filenames means Encrypted.

 

To turn off coloured filenames, in Explorer - Tools menu (Alt + T) - View tab, and then clear the Show encrypted or compressed NTFS files in color check box.

 

Windows compression, encryption, and security work mostly by apply attributes to a folder, and files in the folder inherit from the folder. 

 

If you have any folders suitable for compression find them in Explorer, right click them - Properties - General tab - Advanced button - Compress contents to save disk space. Choose to apply to all files and folders when asked.

 

To use a command line to compress the files in the Favorites folder.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

compact /c /s:"%userprofile%\Favorites" *.*

 

To set favourites to compress future files added

 

compact /c /s:"%userprofile%\Favorites"

 

To view compression details of the Favorites folder

 

compact "%userprofile%\Favorites\*.*"

 
 

Turn off Low Disk Space Warnings

To turn off the feature to show low disk space warnings.

 

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

 

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoLowDiskSpaceChecks" /t REG_DWORD /d 1 /f

gpupdate /force

 

 

Supercharging Disk Cleanup

 

  • How Disk Cleanup works
  • Scheduling Disk Cleanup
  • Creating custom cleaners

 

To see a list of Disk Cleanup cleaners.

Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste).

@echo.&@echo List of cleaners&@echo ================&FOR /F "usebackq tokens=8 delims=\" %i IN (`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches"`) DO @echo %i
List of cleaners ================ Active Setup Temp Folders Content Indexer Cleaner Downloaded Program Files Hibernation File Internet Cache Files Memory Dump Files Microsoft_Event_Reporting_2.0_Temp_Files Offline Pages Files Old ChkDsk Files Previous Installations Recycle Bin Setup Log Files System error memory dump files System error minidump files Temporary Files Temporary Setup Files Temporary Sync Files Thumbnail Cache Upgrade Discarded Files Windows Error Reporting Archive Files Windows Error Reporting Queue Files Windows Error Reporting System Archive Files Windows Error Reporting System Queue Files WLX Thumbnail Cache
 

13 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

great information thanks I am sure I can use this information as well as many others will find it useful...Do you have a website with other useful information and tools available for me to look at.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

If you want to wait till tomorrow (it's 10:40pm and I've been home for an hour and a bit from work after a heatwave) I'll update my things on skydrive as I've been slack for a year. But yes it's all available for download.

www.mvps.org/serenitymacros

is my Win 98/ME and Word 95/97 web site. A lot still applies.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

 
 

Question Info


Last updated July 3, 2020 Views 108,102 Applies to: