It is reasonable that people prefer to delete unnecessary files from computer in order to release free space for new data. Yet, people will think of pressing Delete or Shift + Delete to remove those files generally. Today, I’m going to introduce a new way of file deletion – using Cipher command line tool.

Use Cipher Command to Delete Files Securely

When you delete a file in Windows by using normal ways, it is only the entry, which tells the computer where the actual file is saved, that will be deleted from the master file table. In this way, the deleted file can be recovered easily with data recovery software. Even if you have pressed Shift + Delete to delete a file (which says will permanently delete the selected file), the real content still remains until new data write in and cover it.

[SOLVED] How To Recover Permanently Deleted Files In Windows
[SOLVED] How To Recover Permanently Deleted Files In Windows

How to recover permanently deleted files from Windows 11/10? You can learn some practical methods from this post.

Read More

Thus, you need a safer way to delete confidential/private data. My suggestion is using the built-in Cipher command to delete files securely.

Cipher command line tool

How to Delete Files with Cipher

The following steps to delete files with the Cipher command line tool are finished in a Windows 10 computer.

  1. Click on the search box located in the taskbar.
  2. Type command prompt into the textbox.
  3. Find Command Prompt (Desktop app) from the search result.
  4. Right click on it and choose Run as administrator from the pop-up menu.
  5. Type cipher /w:* (* represents the path of the certain folder/file you want to delete).
  6. Press Enter to execute.

delete files with cipher

This is how to delete files with Cipher securely. As you can see from the picture, this command will overwrite all of the unallocated space for three times (Writing 0x00, Writing 0xFF, and Writing Random Numbers) in order to ensure that the content is completely wiped out.

To help you understand this command better, I’d like to break it down for you.

  • cipher – this is just to let the computer know that you want to use the tool called Cipher right now.
  • /w – this switch tells computer to remove data from available unused disk space released by the deleted files. If this option is chosen, all other options will be ignored. The directory specified can be anywhere in a local volume. If it is a mount point or points to a directory in another volume, the data on that volume will be removed.
  • :* – it refers to the full path to the file/folder you want to delete. For example, you can type: cipher /wf:\Test\Test.txt to delete the Test.txt file securely. Or, you can type: cipher /wf:\Test to delete the whole Test folder.
Note: Please note that there are articles talking about DiskPart – another command line tool. The first one is How To Fix DiskPart Has Encountered An Error – Solved. And the second one is Recover Data Lost By DiskPart Clean – The Work Is Done.

About the Command Line Tool

  • It is used to overwrite all the data in a specific drive or folder which has been deleted already.
  • It will not delete the data that is still using/exists on your drive.

Thus, you must delete the certain file/folder before running Cipher.exe. Then, run the Cipher command to delete files you don’t want other people to recover by using special recovery tools.

Frequently Used Cipher Switches

  • /e – it tells the system to encrypt the specified folders. The certain folder will be marked so that all the files saved here currently or added to this folder later will be encrypted as well.
  • /d – it tells the system to decrypt the specified folders. The certain folder will also be marked. In this way, all the files saved here currently or added to the folder later will be encrypted too.
  • /? – it tells the computer to display help at the command prompt.

If you’re interested in knowing more Cipher command line switches and parameters, please click here.

  • linkedin
  • reddit