Is there a built-in cmd command/utility on Windows that can shred files (delete and overwrite with random data) without the need to use third party software? In linux i would use shred. It a wonderful tool that not only deletes files, but also destroys any "residue" left on the disk by overwriting the data.
Probably not. Unless they added one in Windows 8
I recently purchased a new PC with Windows 7, and the manufacturer bundled a third party shredder application. I infer that either there isn't one as standard (and I've never heard of one) or (less likely?) that the manufacturer added some unnecessary bloatware without the usual sliver of justification.
It's hard to prove a negative though.
Shred only overwrites a file, it doesn't seek out fragments and copies of the data in unallocated disk space (caused by editing, etc.).
You don't need to overwrite a file more than once. Statements to the contrary have been thoroughly debunked long ago.
It doesn't matter what you overwrite it with.
So just copying a sufficiently large but innocuous file over the top will suffice.
You could delete the file and then use cipher:
- Quit all programs.
- Click Start, click Run, type
cmd, and then press ENTER.
cipher /w:driveletter:\foldername, and then press ENTER. Specify the drive and the folder that identifies the volume that contains the deleted data that you want to overwrite. Data that is not allocated to files or folders will be overwritten. This permanently removes the data. This can take a long time if you are overwriting a large space.
It's probably quicker to just copy a big file over the sensitive file, but safer to clear unallocated space.
Piriform's CCleaner offers an option to wipe out free space. File Shredder allows to wipe out a particular file "on deletion time"
**EDIT: Found something on MS' sysinternas. SDelete. Haven't tried but could give it a try.
Not Windows-native, but likely to be already installed for many people reading this question: Git for Windows comes with its own ports of many common Unix utilities, including
shred. By default it's located at
Usage is the same as on Unix-likes, e.g.
C:\"Program Files"\Git\usr\bin\shred.exe myfile.txt
SDelete is as close to native as I've ever found. The reason why it's more secure than other answers is that it doesn't only write random data, it also takes into account the peculiarities of Windows' file systems so it can force the right parts of the disk to be overwritten.
It has no installer, so if you simply extract the files to their own directory in Program Files, than add that to your
PATH, you can use it from the command line as you would
del. It can delete recursively and shreds both the file contents and name.
The first time it runs, it shows an "Agree to Terms" dialogue, so run it once before you script anything with it.
If you consider Powershell to be built-in, then it is possible to write a script let, maybe using
Get-Random to overwrite the content of a file with random values, before deleting it.
This stack overflow question might be useful.
You can use a batch file:
@echo off ::Here change the name of the file to shred set shred_file=MyFile.txt set zero_n=000000000000000000000000000000000000000000000000000000000000000000000000000000000000 set zero_shred=%zero_n%%zero_n%%zero_n%%zero_n% ::Repeat that loop 100 times (delete, overwrite with 100 800 zeroes) for /l %%A in (1,1,100) do ( del %shred_file% /q /f 2>nul 1>nul echo %zero_shred%%zero_shred%%zero_shred% > %shred_file% 2>nul for /l %%a in (1,1,400) do (echo %zero_shred%%zero_shred%%zero_shred% >> %shred_file% 2>nul) ) ::Final delete del %shred_file% /q /f 2>nul 1>nul exit /B 0
I use that when I need to permanently delete a file smaller than approx ~200 kB
Maybe it's not that the correct answer, but it works as it overwrites the file 100 times