Wipe your drives securely with a hidden Windows 7 tool - gHacks Tech News

Wipe your drives securely with a hidden Windows 7 tool

It's always a worry when you get rid of a PC or hard drive that all sorts of personal data could be sitting on it waiting to be stolen.  This is even more important when it comes to business computers.

There have always been a huge variety of hard disk wiping packages available from third-parties, but did you know that Windows 7 has it's own free in-built tool for securely erasing, not just whole hard disks, but specific folders as well?

The cipher.exe tool has been around for years now and is used for managing the EFS (Encrypted File System) feature that preceeded Bitlocker and was first introduced with Windows 2000.  It's run from the Command Prompt (as an Administrator).

With Windows 7 though Microsoft have added a new switch to the tool, and it's one you should definitely use with care!

The command is simply cipher /w:x:\folder where you would substitute x:\folder for the location you want wiped, for instance your D:\ drive or your C:\Users\Mike Halsey\Music folder.

This will write a series of 0s, 1s and then random characters to every sector of the drive or folder to securely erase the data that's stored there.  Believe me, if you do this casually you're not going to get your data back afterwards.

Microsoft say that this feature is here for clearing empty folders and drives that need to be erased, and it's an excellent way to save money on expensive third-party software.

So the next time you're upgrading your hard disk, don't waste your money, just cipher the thing instead.

To display a list of all parameters run cipher /? on the command line. This displays every parameter and a short description that explains what it is used for.

Update: There are free third party tools available that let you perform the same operations. Eraser is one of the programs that you can use for that purpose. You can have the program erase data in folders, hard drives or free disk space of a drive easily.

Wipe your drives securely with a hidden Windows 7 tool
Article Name
Wipe your drives securely with a hidden Windows 7 tool
How to use the built-in cipher Tool of Windows 7 (and newer versions of the operating system) to delete files and folders on a drive securely.

  • We need your help

    Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

    We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats (video ads) or subscription fees.

    If you like our content, and would like to help, please consider making a contribution:


    1. Taomyn said on June 21, 2010 at 9:22 am

      Think I’ll stick with Boot’n’Nuke

      1. Anonymous said on June 22, 2010 at 2:51 am

        *nods*, DBAN is a great tool, it can be found here – http://www.dban.org/download (it goes without saying, use with care!)

    2. Beecher Bowers said on June 22, 2010 at 2:43 pm

      You’ll need to delete everything on the drive PRIOR to using the /W switch. The switch doesn’t actually delete anything.

      This switch only overwrites “available unused disk space on the entire volume”. If you have contents in the location, they won’t be overwritten, per the /w switch documentation.

      This switch is also available on Windows XP.

    3. 123456 said on June 22, 2010 at 6:43 pm

      Mike, please do us the favor of NOT writing here any more, before you are able to at least the manuals.
      As was already stated, it’s not important where the drive is mounted if you use /w as _all_ unallocated space gets wiped.
      cipher.exe /w c: will overwrite nothing important, just the empty reported blocks. No allocated blocks will be touched, meaning it does NOT delete anything!

      So the tool will not ‘wipe’ a drive as understood by the masses.

    4. Dave Brown said on February 4, 2012 at 5:45 pm

      For my part, I have no use for a tool that will delete all data found on a machine (DBAN/Boon’n’Nuke), so this article has been very helpful. All I want to do is ensure there’s nothing remaining on a drive that used to be my primary but I now have in an external case for my clients to use to send me video files. cipher /w:j:\ was perfect.

      1. Dave Brown said on March 1, 2012 at 1:57 pm

        …and I’m using this technique again on a failing backup drive that I’m returning to the vendor for replacement. Again, don’t want to wipe all drives, just one.

    5. Jesse said on October 30, 2012 at 5:46 am

      Correction: The correct command is:

      cipher /w:x:\folder

      If you want to watch it work open the folder and it creates a EFSTMPWP folder with a .tmp file that will fill the drive 3 times with 00, FF and random numbers

      Here is an example run on a 4GB flash drive that took approx 1 hour:

      C:\> cipher /w:G:\
      To remove as much data as possible, please close all other applications while
      running CIPHER /W.
      Writing 0x00
      Writing 0xFF
      Writing Random Numbers

    6. Alison said on April 22, 2013 at 5:58 pm

      i need to swipe my data on my laptop

    7. Dave said on December 18, 2013 at 9:39 pm

      I did use the cipher/w:e\folder. It took quite a long time writing 0x000 then writing 0xFF and then writing Random Numbers, but after it was done the e drive had files on it.

    Leave a Reply