Cleaning windows after update.

Page 2 of 2 FirstFirst 12

  1. Posts : 26
    windows10
       #11

    While you can just delete large folders, the best way to regain space is by using the built in Disk Cleanup tool.
    Click Start and type 'Disk Cleanup'. Right-click the application that appears, and select 'Run as administrator'. Select the drive you want to clean up -- this should be your system drive -- and click OK.
    The tool will calculate how much space can be saved and then present you with a list of items that can be cleaned, including some very large ones.
      My Computer


  2. Posts : 5,478
    2004
       #12

    Josey Wales said:
    If you run it as Admin, it will automatically clean system files.
    Not quite. You still have to tick the boxes just not press the "cleanup system files" button.

    That is why people do the cleanmgr /sageset:65535 & cleanmgr /sagerun:65535 as it saves ticking the boxes.

    You can even script it to do the ones you want (if you didn't want it clear logs or empty the recycle bin or something).

    I'd give credit for this script but I forgot who I copied it off.
    Code:
    $VName="StateFlags0032"
    $DirPath="HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches"
    
    # Folders Names which will been cleaned.  Note some of these (for example "RetailDemo Offline Content") are deleted from
    # the registry after first run.  Messages like "Key not found" are therefore not important and can be ignored.
    
    [email protected](
    "Active Setup Temp Folders",
    "BranchCache",
    "Content Indexer Cleaner",
    "Delivery Optimization Files",
    "Downloaded Program Files",
    "GameNewsFiles",
    "GameStatisticsFiles",
    "GameUpdateFiles",
    "Internet Cache Files",
    #"Memory Dump Files",
    "Offline Pages Files",
    "Old ChkDsk Files",
    "Previous Installations",
    #"Recycle Bin",
    "RetailDemo Offline Content",
    "Service Pack Cleanup",
    "Setup Log Files",
    "System error memory dump files",
    "System error minidump files",
    "Temporary Files",
    "Temporary Setup Files",
    "Temporary Sync Files",
    "Thumbnail Cache",
    "Update Cleanup",
    "Upgrade Discarded Files",
    "User file versions",
    "Windows Defender",
    "Windows Error Reporting Archive Files",
    "Windows Error Reporting Queue Files",
    "Windows Error Reporting System Archive Files",
    "Windows Error Reporting System Queue Files",
    "Windows Error Reporting Temp Files",
    "Windows ESD installation files",
    "Windows Upgrade Log Files")
    					
    Write-Host "The following are selected to be cleaned by cleanmgr" -f cyan 
    
    $error.clear()
    
    For($i=0;$i -lt $TempFolders.Count; $i++) {
        $RegKey=$DirPath + "\" + $TempFolders[$i]
        $StateValue=(Get-ItemProperty $RegKey).$VName
        If ($?) {
            If ($Error.categoryinfo) {write-host "Key not found " -f red  -NoNewline; write-host ": " $TempFolders[$i] -f White}
            ElseIf (-not $StateValue) {
            New-ItemProperty -Path $RegKey -Name $VName -Value "2" -PropertyType "dword" | out-null
    
            write-host "Key added     " -NoNewline; write-host ": " $TempFolders[$i] -f White
        } Else {
        Set-ItemProperty -Path $RegKey -Name $VName -Value "2"
        write-host "Key updated   " -NoNewline; write-host ": " $TempFolders[$i] -f White
    }
    
    $error.clear()
    $RegKey=$DirPath
    
    Write-Host "End of List" -f cyan
    	
    # 32 is a random number - just has to match $VName variable
    
    CLEANMGR /sagerun:32
    Write-Host  "Disk Cleanup running asynchronously..." -f white
      My Computer


  3. Posts : 5,478
    2004
       #13

    robertosburn said:
    While you can just delete large folders, the best way to regain space is by using the built in Disk Cleanup tool
    Deleting one large folder is obviously the best way to reclaim disk space. Deleting a 20GB Windows.old is more efficient than deleting lots of 3MB temp files.

    Disk Cleanup is a way to delete junk you don't need. As are the various other temp places mentioned earlier by @TairikuOkami

    I use CCleaner and TFC as well. They probably duplicate each other but never mind.

    There are lots of other interesting things you can do (most of which make no difference) but I would suggest that compression is the best way to reduce disk space and that it also improves performance (unless you have an exceptionally fast SSD and a really really poor CPU.

    Ignore what MS says and run Compact /compactOS:always

    Then run from admin prompt compact /c /s /a /f /q /i /exe:xpress16k for all your folders containing games or documents.

    It will certainly reduce the size and in my testing makes things faster in every situation (even with HDD)

    You may need to change xpress16K toxpress 8K if your CPU is weaker than your disk but doing anything is better than nothing.

    Just for your interest xpress4K is the default compression (which is used by /compactOS) and even that is faster in any situation I have tested.

    Just to make it clear, I'll put it in bold.

    Everything I've tested, including games, runs faster if it is compressed on disk irrespective of the hardware (SSD/CPU etc)

    Going back to not bold, you may want to check different compressions. Even NTFS compression is better than nothing though.
      My Computer


  4. Posts : 1
    windows 10
       #14

    swarfega said:
    You can use cleanmgr.exe to clean all the temperary installation files.

    Attachment 130222
    I tried CC cleaner and it deleted windows.dll files when using with windows 10
      My Computer


  5. Posts : 7,257
    Windows 10 Pro 64-bit
       #15

    This is a 3 year old post, I have since stopped using CC but I've never heard it delete a system file.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 04:59.
Find Us




Windows 10 Forums