How To Delete File and Folders Completely and Securely with sdelete in Windows?
User PC and Servers process a lot of data where some of them are secret. This data may be deleted with conventional ways but this may not enough. Because file systems generally removes file metadata but continue to hold real data. Microsoft sysinternals provides
sdelete or secure delete tool which can delete file data really. More information about sysinternals can be get below.
As stated before
sdelete is provided by sysinternals. So
sdelete can be downloaded from sysinternals site where exact dowload url is provided below.
Delete File Completely
We will start with simple example. We will delete sile named
Sdelete.zip which resides in
Users\İsmail Baydan\Downloads . We can not delete directory without providing recursive option which we will see below. We double quotes to provide file path.
PS> sdelete.exe "C:\Users\İsmail Baydan\Downloads\SDelete.zip"
Remove Read-Only Attribute
NTFS and FAT file systems provides some protection mechanisms to prevent delete files accidentally. This may create bottleneck if we are sure and want to delete file with
sdelete. In this situations we can provide
-a option which will remove read-only attribute from file before deleting securely. In this exmaple we will delete file named
PS> sdelete.exe -a ntds.dit
Delete Files and Folders Recursively
Without providing any option we can delete files one by one. This is not efficient way to delete directories those provides a lot of files. By using
-s recursive option we can delete directories and folders and all of their contents. In this example we will delete folder named
PS> sdelete.exe -s ".\Temp"
Zero Free Space
Some file formats may hold less data than consumed disk space. This generally happens in virtual machines disk images and formats like
qcow . We can use
sdelete to zero free space in this type of files. We will use
-z option. In this example we will zero disk images named
PS> sdelete.exe -z ubuntu.vmdk
Specify Overwrite Passes
sdelete will overwrite given file data only once. IF we have strict policy like deleting files by overwriting them 5 times we cna use
-p parameter with number of passes. Higher number of passes will be more secure but will take more time. In this example we will overwrite file named
password.txt 5 time.
PS> sdelete.exe -p 5 password.txt