PDA

View Full Version : sdelete script help


n8chavez
April 7th, 2009, 04:05 AM
I'm trying to add the ability to use sdelete within the context menu to erase files and/or folders securely. I know about the alternatives, but I admittedly like command line applications. I might need a little help in doing so because nothing I have tried as worked.

I have created the following registry entry, which then points to the below bat.

{QUOTE-> Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Secure Delete]
@=""

[HKEY_CLASSES_ROOT\*\shell\Secure Delete\command]
@="C:\\windows\\sdelete.bat"
<-QUOTE}


sdelete.bat

{QUOTE-> @echo off
:START
if "%~f1"=="" (
echo No more args given. Done.
pause
exit /b 0
)

:WORK
attrib -h -s -r -a "%1" /S /D
"C:\windows\sdelete.exe" -p 3 -s "%1"

:NEXTARG
shift
goto START <-QUOTE}

I cannot figure out why this does not work. When I execute the script I'm told that sdelete is using an invalid argument switch. I can only guess that it is referring to the "%1". But I believe that to be correct.

Any ideas?

snowdrift
April 7th, 2009, 08:51 AM
; context_sdelete.inf

; Adds Zap Free Space to the right click context menu in Windows XP

; Make sure sdelete.exe is in the PATH (\windows\system32\)

[version]

signature="$CHICAGO$"

[DefaultInstall]

AddReg=AddMe

[AddMe]

HKCR,"Drive\Shell\Zap Free Space\command",,,"C:\windows\system32\sdelete.exe -p 1 -z -c %1"

Pleonasm
April 7th, 2009, 10:25 AM
N8chavez, the problem you are pursuing has been explored in this thread: My handy sdelete scripts (http://forum.sysinternals.com/forum_posts.asp?TID=6065).

Personally, I rarely use Sdelete, now preferring R-Wipe&Clean (http://www.r-wipe.com/) (which integrates into the right-click context menu for Windows Explorer).