[Detailed Guide] CMD Delete File & Folder

Want to delete file by CMD? You can learn how to delete files and folders via CMD, completely shred files to protect privacy. And if you need, you can also check how to recover accidentally deleted files and folders.

Lucas

By Lucas / Updated on March 13, 2024

Share this: instagram reddit

About CMD delete file & folder

If you're a Windows user looking to perform advanced operations or solve specific issues, CMD is your go-to tool. In this guide, we'll walk you through using CMD to delete files and folders swiftly and efficiently. Command Prompt is a powerful command-line interpreter application exclusive to Windows operating systems. It's commonly referred to as cmd.exe or simply cmd.

Think of it as a backstage pass to your system, allowing you to execute various commands and perform tasks beyond what graphical interfaces offer.

Why delete file using CMD?

While graphical interfaces provide a user-friendly experience, CMD offers speed and efficiency, especially when dealing with multiple files or folders. Whether you're removing stubborn files or clearing junk files, CMD's del and rmdir commands are your allies.

Use CMD delete file step-by-step

Before we start, you need to know the difference between dragging files to Recycle Bin and CMD file deletion.

When files are deleted using Command Prompt, they are typically removed from the system permanently, bypassing the recycle bin. This is useful when you need to free up disk space immediately or ensure that sensitive files are not recoverable.

Files moved to the recycle bin remain there until the bin is emptied or the files are manually restored. Until then, they can be recovered easily, providing a safety net against accidental deletions.

So, in this case, you might not easily retrieve deleted files and folders manually if you regret removing your data.

1. How to delete a file in CMD

Step 1. Click "Start", and you'll see the search box.

Step 2. Type in cmd.

Step 3. Right-click cmd and select "Run as Administrator".

Step 4. Now you can use Command Prompt to delete files.

Step 5. Type in del with a space after it.

Step 6. Then type the path for each file you want to delete, and remember to add spaces to separate each file name.

Delete a file in CMD

Step 7. Make sure you type in the right path and press the Enter key.

2. How to delete folder in CMD

Another command you can use to delete folders is rmdir.

Step 1. Type in rmdir with a space after it.

Step 2. Then type the path for each folder you want to delete.

Delete folder CMD

Step 3. Make sure you type in the right path and press the Enter key.

Can you recover files deleted by CMD?

Since CMD commands are not an easy tool for all users, some users may accidentally delete the wrong files or folders during the operation. As we told you CMD deletion can’t be recovered manually. So, if you find you lost some crucial data, you’ll need a professional data recovery tool.

Discover the seamless solution to retrieve lost files with AOMEI Partition Assistant Professional's cutting-edge "Recover Data" feature. Whether files have vanished due to accidental deletion, formatting, or system errors, this versatile tool empowers users to effortlessly recover their precious data.

Noteworthy is its broad compatibility across various Windows operating systems, including Windows 11, 10, 8, 8.1, and 7. In addition, it has the Server edition for Windows Server users. So, no matter your system configuration, this tool ensures a smooth and reliable file recovery experience.

Step 1. Install and launch AOMEI software. Click "Recover" > "Recover Data" on the taskbar.

recover-data

Step 2. Then, the Recover Windows Data tool will pop up. Select the partition where you store the lost pictures and click "Start Scan".

recover-windows-data

Step 3. Once the scan is completed, all deleted files, recycle bins and other missing files will be displayed. Please select the photo you would like to recover and then click "Recover".

select-recover-data

Step 4. Then, select a folder path to store your recovered files.

select-saved-path

Step 5. Wait patiently for this process of recovering permanently deleted files Windows 10 ends.

restore-successfully

Bonus tips: Shred & wipe your privacy completely

CMD is quite a nice tool for you to manage your data files. But if you wish to wipe completely and erase single files or clean the whole hard drive, the best choice will always be a PC tool. Luckily, AOMEI Partition Assistant is a multifunctional program for solving PC and hard disk issues.

You can employ "Shred Files", "Wipe Hard Drive"(for HDD), and "Secure Erase SSD"(for SSD) to clear data according to your different cases.

Option. 1. Shred files

Shredding files or folders makes it difficult to restore them, even using data recovery tools. Make sure you truly want to remove them permanently. 

Shred files permanently

Option 2. Wipe Hard Drive

This function allows you to wipe a hard drive using four different methods: zero-filling, filling sectors with random data, DOD wipe, and Gutmann.

Wipe disk

Option 3. Secure Erase SSD

Due to differences in storage methods, this wiping method is rarely used to erase an SSD and has a detrimental impact on its longevity. AOMEI Partition Assistant now provides another option, SSD Secure Erase. It is designed specifically for solid-state drives and allows you to delete all data on an SSD without reducing its lifespan.

SSD secre erase

To sum up

Using CMD delete file may not be easy for all users, so make sure you type the right path of your target files or folders. If you make mistakes, don't worry, AOMEI Partition Assistant can help you.

Also, if you want to clean your disk, there are other options for you in this handy tool. Besides the functions we've mentioned, there are disk cloning, MBR/GPT data-safe conversion, PC cleaner, App Mover and so on for your disk and computer management.

Lucas
Lucas · Staff Editor
I prefer peaceful and quiet life during vacation,but sometimes I watch football match if my favorite club performs brilliantly in that season. And I love reading, painting and calligraphy, thus I send my friends festival handwriting cards every year.