How to Remove the Unnecessary Files Using CMD

By | June 5, 2022

Do you know, how to remove the unnecessary files using CMD? When you run the Windows operating system, it automatically created many system error memory dumps files. These files automatically stored in the local drive on C, where Windows is installed. Just follow the few steps, let’s see –

How to Remove the Unnecessary Files Using CMD –

At first, you need to click on the start button or simply press the Windows button key.
Then, type Cmd. and now right-click the command prompt and simply select the Run as administrator.
How to Remove the Unnecessary Files Using CMD
When the Window opens then types following below command. When after the other and just press the after each command.

fsutil usn deletejournal /d /n c:
del “%temp%*” /s /f /q
del “C:$Recycle.bin*” /s /f /q
del “%systemroot%temp*” /s /f /q
vssadmin delete shadows /for=c: /all /quiet
Dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase



Finally, restart the computer and automatically unwanted files will be gone by now.

To remove unnecessary files using CMD:

Delete individual files:

Use “del” command with the file path.

Delete files from a specific folder:

Use “del” command with wildcard (*) for all files in the folder.

Delete files with a specific extension:

Use “del” with wildcard and file extension.

Delete empty folders:

Use “rd” command for empty folders.

Delete folders and their contents:

Use “rd /s” for folders with subfolders/files.

Empty Recycle Bin:

Use “rd /s /q” for clearing the Recycle Bin.

Exercise caution as file deletion is irreversible. Backup important data before using CMD.

Other Articles –
How to Delete Files from PowerShell
How to Stop Windows 10 Update Completely Guideline

Leave a Reply

Your email address will not be published. Required fields are marked *