Delete files and free disk space securely with SDelete

0
181

SDelete is a free command line utility by Microsoft’s Sysinternals team that you may use to delete files and free disk space securely.

While you can delete any file on a hard drive connected to a machine running Windows using Explorer, the command line or other means, deleting files this way won’t remove the data immediately from the drive.

Without going into too many details, what happens is that Windows removes reference to the data on the hard drive, and makes the space the file occupies on the hard drive available again for write operations.

Once that space gets overwritten partially or fully, the file cannot be recovered anymore. Since you cannot determine when that is going to happen, you may end up with files being still available on the drive that you have deleted months or even years ago.

This is bad for a number of reasons. Say, you want to sell the hard drive or PC, or give it away. Since you hand over the hard drive, the new owner could run file recovery software on it to recover deleted files. Another example is handing over a PC to support or repair staff.

I did use Eraser for that purpose previously, but the program crashes each time I run it on Windows 10 machines.

SDelete

sdelete-software

SDelete is a free command line tool that you can use to delete files securely so that they cannot be recovered anymore.

The program overwrites the data on the hard drive directly when it is run to prevent file recovery software from picking up traces of deleted files and data.

The application has two main use cases: delete files securely to prevent recovery, or overwrite free disk space securely to delete traces of previously deleted files on it.

You can download SDelete from the Microsoft website. You find a detailed article on it and its use as well. Extract the archive to your system. Since SDelete is a command line tool, you need to run it from the command line.

One easy option to open the SDelete folder on the command line is to open it in Windows Explorer, type cmd in the Explorer address field, and hit the Enter-key. This should open a command prompt at that location.

Read also:  HARDiNFO: hardware and system tool for Windows

Deleting files or folders securely

The command sdelete <file or directory> is the base command for any file or directory operations. Here are some examples that demonstrates the different options that you have:

  • sdelete -s c:usersmartindownloads — This deletes the folder downloads and all subdirectories securely.
  • sdelete -q c:usersmartintext.txt — This deletes the file text.txt securely, and suppresses any error messages.
  • sdelete -p 5 c:*.zip — This deletes all zip files under c:, and runs the operation in five passes.

Deleting free disk space securely

The base command sdelete -c <drive letter> deletes free disk space on the specified drive securely. Here are some examples that demonstrate the various options that SDelete offers:

  • sdelete -c c: — Deletes the free disk space on drive C: securely.
  • sdelete -c -p 2 f: — Runs two delete passes on the free disk space of drive f:
  • sdelete -z d: — Zeroes the free disk space of drive d:

SDelete uses the Department of Defense algorithm by default when it deletes files, folders or free disk space. The -z parameter overwrites the free disk space with zeroes instead which is faster.

The operations may take quite some time to complete. The length it takes depends on the selection. Deleting individual files securely is pretty fast, but it may take hours or even longer if you run the operation on large folders or free space of entire hard drives.

It is recommended to run recovery software afterwards on the path to verify that the files cannot be recovered anymore.

Closing Words

SDelete is a handy, tiny program which you may use to delete files or folders securely, and to process free space on hard drives so that any content that was once store on those drives cannot be recovered anymore.