File Shredder Shortcut using SDelete in Windows XP, Vista, 7

Computer enthusiasts have been using file shredders to delete files for many years. Sysinternals makes a very cool utility called “SDelete” that “shreds” a file

See below for batch file code snippet to use with SDelete. Add to your “User/Administrator/AppData/Roaming/Microsoft/Windows/SendTo” (In Vista/7/Serv08) or “Documents and Settings\%username%\SendTo” (In XP).

(%APPDATA% environment variable actually points to “C:\users\\AppData\Roaming”)

I have modified the code below from it’s original source on blog (see references) to 3 passes instead of four. See wikipedia page for more information on data remanence. If the script runs slow on your system consider decreasing this to 3 or 4.


@echo off
:START
if "%~f1"=="" (
echo No more args given. Done.
exit /b 0
)
:WORK
ECHO Y| cacls %1 /T /C /G Administrators:F
attrib -h -s -r -a %1 /S /D
attrib -h -s -r -a %1\*.* /S /D
sdelete -p 7 -s -q %1
:NEXTARG
shift
goto START

Addendum 2012.11.09
Windows 7 environment path seems to be buggy at times. Absolute references to executables is more reliable.

@echo off
:START
if "%~f1"=="" (
echo No more args given. Done.
exit /b 0
)
:WORK
ECHO Y| C:\Windows\System32\cacls.exe %1 /T /C /G Administrators:F
C:\Windows\System32\attrib.exe -h -s -r -a %1 /S /D
C:\Windows\System32\attrib.exe -h -s -r -a %1\*.* /S /D
C:\Windows\System32\sdelete.exe -p 7 -s -q %1
:NEXTARG
shift
goto START


Note:
Any snippets may have been condensed from their original sources for brevity. See references for original articles.

All server side code examples are in C# .Net.

References
Sysinternals, Blog: “My Handy sdelete scripts”, Soulstace, http://forum.sysinternals.com/my-handy-sdelete-scripts_topic6065.html
Wikipedia, “Data Remanance”, http://en.wikipedia.org/wiki/Data_remanence
HowToGeek, http://www.howtogeek.com/howto/windows-vista/customize-the-windows-vista-send-to-menu/

About Ronnie Diaz

Ronnie Diaz is a software engineer and tech consultant. Ronnie started his career in front-end and back-end development for companies in ecommerce, service industries and remote education. This work transitioned from traditional desktop client-server applications through early cloud development. Software included human resource management and service technician workflows, online retail e-commerce and electronic ordering and fulfillment, IVR customer relational systems, and video streaming remote learning SCORM web applications. Hands on server experience and software performance optimization led to creation of a startup business focused on collocated data center services and continued experience with video streaming hardware and software. This led to a career in Amazon Prime Video where Ronnie is currently employed, building software and systems which stream live sports and events for millions of viewers around the world.

Posted on February 7, 2011, in Programming & Development, Security & Cryptography and tagged , , , , , , , , , , , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: