The secure_delete.bat
bash script is designed to securely overwrite and optionally delete files on Windows, ensuring that the files cannot be easily recovered using basic recovery tools.
It can handle all file types, including binary files such as images, videos, documents, and more.
File Overwriting: The script overwrites file contents with random data and zeros, making it difficult to recover the original data.
Supports All File Types: It securely processes binary files (images, videos, etc.) and text-based files alike.
Recursive Operation: When using the -R
option, the script traverses directories and securely processes all files.
Optional File Deletion: If the -D
option is provided, files are deleted after being securely overwritten.
To securely overwrite a single file without deletion:
secure_delete.bat C:\path\to\file.txt
To securely overwrite and delete a single file:
secure_delete.bat C:\path\to\file.txt -D
To securely overwrite all files in a directory recursively, without deletion:
secure_delete.bat C:\path\to\directory -R
To securely overwrite and delete all files in a directory recursively:
secure_delete.bat C:\path\to\directory -R -D
- The
-D
option controls whether the file is deleted after being securely overwritten. - The
-R
option ensures the script runs recursively on all files in a directory.
Always be cautious when using this script as it permanently overwrites and deletes files, making recovery difficult or impossible.