[Home] [Downloads] [Search] [Help/forum]



Program to walk the directory tree (from a nominated starting point) and securely delete every file it finds, and remove directories.

The purpose of this is to remove files and/or directories in a way that they cannot be later recovered by someone armed with a delete-recovery or disk editing program.

You might, for example, use it to delete files when:


The program does this by:

  1. Walking the directory tree from a nominated starting point or considering a single file name supplied on the command line
  2. Counting files and directories
  3. Displaying the total and asking if you want to proceed
  4. For each file, it then opens the file for writing, and writes seven passes over the top of the existing data in the file
  5. The first pass consists of all zero bits, the second pass all one bits, and the subsequent passes randomly generated bits. The purpose of this is to defeat people armed with low-level disk analysers that might conceivably reconstruct your data if it was only changed to zeroes or ones.
  6. After the seven passes, the file is then removed from the disk directory.
  7. After each directory is processed the directory itself is removed



On the command line, specify the file or directory you want to delete. You cannot use wildcards. You either delete a single file, or a single directory.

Security considerations

This program was designed to help protect your old unwanted files from being viewed by other people. However if your files are highly confidential there are other steps it would be prudent to take, for example, encrypting them when you are not actually using them.

You should also consider taking steps to overwrite any old data that might be lying around on the hard disk from when files were deleted using an insecure method. To address this the companion program DeleteUnused has been written, which overwrites all unused sectors with random patterns.

In addition, make sure that "backup" files (eg. files ending in .BAK, and possibly other extensions) do not contain earlier versions of sensitive data.


The author does not accept responsibility for any files you may accidentally delete with this program. Use it with care.

This program does not pretend to solve all of your security problems on your PC. You are recommended to read some of the very good books on computer security and encryption to further your understanding of those issues.


To download, click on the "downloads" button at the top of this page.


This program is supplied free of charge. It is copyright 1998 by Nick Gammon. Source code is available from the downloads area.

[Back] [Home]
Written by Nick Gammon - 5K

Comments to Gammon Software support

[Best viewed with any browser - 2K]    Internet Contents Rating Association (ICRA) - 2K    [Hosted at HostDash]

Page updated on Wednesday, 15 December 2004