Basic clean-up, check-up and repair of windows\n\n\n\nAuthor: Sysnative Moderator xilolee \n\n\nPreamble:All commands should be used from an elevated command prompt, i.e. with administrator rights.\nWindows xp main user was usually an administrator (IIRC).\nFrom windows vista onwards, you need to perform a special sequence to open an elevated command prompt, even in an administrator account.\nThe simpler method that should work for all windows versions (I didn't tried with xp :-P) should be: click windows start, in the searchbox type cmd, press and hold ctrl and shift keys, press enter, release all keys, respond yes to the user account control window that should appear (from vista onwards).\nYou will find here a brief panoramic of windows tools that allow you to perform a basic clean-up, check-up and repair of your machine.\n\n\nCleanmgr (Clean manager?)\n(Command available since windows 2000)Also known as Disk Cleanup (its GUI version), this tool exists since windows 2000 (at least) and its aim is to remove unnecessary files from your drives.\nYou can run it anytime you desire. In the command prompt, typecleanmgr \/sageset:1A cleanmgr window will be presented, in which you can choose the items to be deleted.\nI'd select them all, but you can choose to avoid some options.\nTo start the cleanup, you need to launch this other command:cleanmgr \/sagerun:1And the cleanup will start: wait until it finishes.\n\nThe sageset\/sagerun options allow up to 65535 combinations and their aim is to be used in a scheduled task, that should be run with the highest privileges.\nWindows 10 Storage Sense\n(Command available since windows 10 version 1709)This is the new tool to remove unnecessary files on windows 10 machines only.\nIt seems it is available since Windows 10 Fall Creators Update - Windows 10 version 1709 (2017 September = 1709) - Redstone 3 - 10 version 1709 build 16299.\nWith Windows 10 October 2018 Update - Windows 10 version 1809 (2018 September = 1809) - Redstone 5 - 10 version 1809 build 17763, the cleanmgr tool is declared as deprecated (abandoned).\nYou can find it in settings, system, storage, free up space now: windows will scan the drive and you will choose what items have to be deleted.\nIt is also possible to make it run automatically on its own, changing the sliding bar under storage sense from off to on; and change some basic settings about it in Change how we free up space automatically.Note: windows sentences and picture were taken from windows 10 version 1803 (April 2018 update) - Redstone 4 - 10 version 1803 build 17134.\nDISM - reduce the winsxs folder\n(DISM = Deployment Image Servicing and Management)\n(Switches available from Windows 8 onwards)The DISM application can be used to reduce the winsxs folder.\nYou can run it after an important windows upgrade, after cleanmgr.\nYou can also do a previous analysis with this command:dism \/online \/cleanup-image \/AnalyzeComponentStoreThe following command works from windows 8 onwards; it will start the cleanup and you should wait until it finishes:dism \/online \/cleanup-image \/startcomponentcleanupThis one, from windows 8.1 onwards; it does almost the same as the previous one, but its action should be deeper:dism \/online \/cleanup-image \/startcomponentcleanup \/resetbase\nDISM - check, scan, restore the health of your OS\n(switches available from Windows 8 onwards)The following command lasts a few of seconds (or even less) and check your OS health:Dism \/Online \/Cleanup-Image \/CheckHealthPossible results:\n- healthy: "No component store corruption detected."\n- repairable: "The component store is repairable."\n- non-repairable: "The component store is not repairable." (I'm not sure if this is the exact error message)\n\nThe following command lasts some tenth of minutes and scan your OS health (without trying a repair):Dism \/Online \/Cleanup-Image \/ScanHealth\nThe following command lasts some tenth of minutes and restore your OS health (if possible):Dism \/Online \/Cleanup-Image \/RestoreHealth\nSFC (System File Checker)\n(Command available since windows 98)This tool allows you to "scan Windows and restore your files" (quoted from Microsoft webpage about sfc).\nLaunch the following command and windows will check and eventually will repair system files:sfc \/scannowIf it will find no integrity violations or if it will repair all system files, no problem.\nOtherwise, post a new topic in our windows update sub-forum and the windows update experts will help you to fix the corrupted files.\nDEFRAG (Defragmenter)\n(Command available since windows 95)This command sorts the files in your drives.\nYou'll rarely should use this command given that windows (since Vista) automatically defrag each partitions every week.\nYou might use it when you feel slowdowns in your machine (it is "sluggish"), after you used the previous tools.\nIt changed from windows xp to windows 10; currently, the following command works (for sure) in windows 10:defrag c: \/hIt means "Sort files in c: with a higher priority" (it runs usually in low priority, the \/h switch will make it run at normal).\nCHKDSK (Check Disk)\n(Command available since DOS)Some years ago (circa, in DOS era up to Win2000 era), a partition and a disk were almost the same thing.\nBut now, it checks the partitions.\nYou might use it after the defragmenter, when you perceive that there are problems in your machine.\nLaunch the following command and windows will check and eventually will repair the partition inconsistencies:chkdsk c: \/bIt means "Check the c: partition (the main partition, usually), fix its errors, locate bad sectors and recover readable information, re-evaluate bad clusters on the volume.\nI.e., \/f and \/r switches are implied by the \/b switch.\nIt will ask to reboot the machine (to start, run and complete this check).