0% found this document useful (0 votes)
13 views

Storage Clear up commands

The document provides a list of Command Prompt commands for cleaning up unnecessary files on Windows systems. Key commands include Disk Cleanup, deleting Windows Update files, clearing cache, and using System File Checker and CHKDSK for system maintenance. These commands aim to optimize system performance by removing outdated files and improving disk space usage.

Uploaded by

Favor Shatamon
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Storage Clear up commands

The document provides a list of Command Prompt commands for cleaning up unnecessary files on Windows systems. Key commands include Disk Cleanup, deleting Windows Update files, clearing cache, and using System File Checker and CHKDSK for system maintenance. These commands aim to optimize system performance by removing outdated files and improving disk space usage.

Uploaded by

Favor Shatamon
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Storage Clear up commands

To clean up unnecessary files and scan for old versions of files that are not being used, you can
use several commands in Command Prompt (CMD) on Windows. Here are a few useful
commands to clean and optimize your system:

1. Run Disk Cleanup (Cleaning temporary files, system files, etc.)

You can trigger the Disk Cleanup tool from the command line to remove unnecessary files.

cleanmgr

This command opens the Disk Cleanup utility. You can choose to clean system files, temporary
files, and other unneeded data.

To clean up files automatically without manually selecting options, you can run:

cleanmgr /sagerun:1

First, you would need to configure which types of files to delete by running:

cleanmgr /sageset:1

Then, select the types of files you want to delete (like system files, temporary files, etc.).

2. Remove Windows Update Files

Sometimes, old Windows updates can take up space. You can use this command to remove
them:

del /s /q /f %windir%\SoftwareDistribution\Download\*.*

This command deletes the downloaded update files.

3. Clear Cache Files

Clear temporary cache files by running:

del /q/f/s %TEMP%\*


del /q/f/s C:\Windows\Temp\*

4. Delete Old Versions of Files (System File Checker)

If you're concerned about outdated system files, you can use the System File Checker (SFC)
tool to scan and repair missing or corrupted system files.
sfc /scannow

5. Check and Clean the Disk with CHKDSK

If you suspect there are issues with your disk, use the following command to check for errors:

chkdsk C: /f

This checks the C drive for errors and attempts to fix them.

6. Delete Windows.old Folder (Old Windows Installation)

If you've recently upgraded Windows and the previous version is still present as a Windows.old
folder, you can remove it to free up space:

rd /s /q C:\Windows.old

7. Delete System Restore Points (if not needed)

If you want to delete old system restore points to free up space, you can use the following
command:

vssadmin delete shadows /for=C: /all

This deletes all system restore points, so use it with caution.

8. Use DISM to Clean Up the System Image

If you're running Windows 8 or later, you can use the DISM command to clean up system files:

DISM /Online /Cleanup-Image /StartComponentCleanup

This will remove old versions of system files that are no longer needed.

Summary of Commands:

 cleanmgr (Disk Cleanup tool)


 del /q/f/s %TEMP%\* (Clear temp files)
 del /q/f/s C:\Windows\Temp\* (Clear system temp files)
 sfc /scannow (System File Checker)
 chkdsk C: /f (Check and fix disk errors)
 rd /s /q C:\Windows.old (Delete Windows.old folder)
 vssadmin delete shadows /for=C: /all (Delete restore points)
 DISM /Online /Cleanup-Image /StartComponentCleanup (Clean system image)
These commands will help you clean up unnecessary files and improve system performance by
removing outdated files and versions.

You might also like