I've wrote a quick approach utilizing the Random Data File Creator.
Mike noted that RDFC doesn't correctly fill the file with random data. I've emailed the author and reported this issue. For the time being, I've implemented a drop-in replacement for
rdfc.exe
. If you want to compile and use it, please see How do you compile a project from source?
This Windows command line script will do what you want:
@ECHO OFF SETLOCAL IF "%1"=="" GOTO missingParam GOTO :begin :missingParam ECHO Missing target. Use %~nx0 [DRIVE:\]DIRECTORY GOTO :eof :begin SET RDFC=%CD%\rdfc.exe PUSHD %1 CALL :treeProcess POPD ENDLOCAL GOTO :eof :treeProcess FOR %%f IN (*.*) DO ( ECHO | SET /P=Shredding %%f... %RDFC% %%f %%~zf B overwrite > NUL ECHO %%~zf random bytes written. ) FOR /D %%d IN (*) DO ( CD %%d CALL :treeProcess CD .. ) EXIT /B
It requires that rdfc.exe
is placed in the same directory as the script. The script will require 1 parameter, the target directory. Every single file in the target directory will be replaced with a file of exactly the same size, but filled with random data.