Wipe files using sdelete ?

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Not patient, but ---

Post by *Clo »

2karlchen

:) Hi Karl !

• I'm not a patient guy really… Just UV-Pro >> Search %S >> Search Next button ++++ down to the last found… :P

:mrgreen: VG
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

[OT] RE: Not patient, but ---

Post by *karlchen »

Hi, Clo.

You are right and I am a lazybones. :lol:
Even using the internal lister, setting it to do a case-sensitive search and searching for "%S" I had to press F3 only 5 times. Latest history.txt.

Cheers,
Karl
User avatar
trininja
Junior Member
Junior Member
Posts: 21
Joined: 2009-04-07, 22:10 UTC

Post by *trininja »

Hi,

I run on Vista Home Premium 32bit and have one little problem: I called the batch wipe.cmd, when I try to get it running of the Totalcmd dir. When I put wipe.cmd into C:\, and it works without any problem, but I don't want the batchfile in C:\.

I tried everythink mentioned here, but it only works in the combo with wipe.cmd in C:\, sdelete.exe can be everywhere.
#153491 - Personal Licence

"Ich geh kaputt, wem darf ich was mitbringen?"

"Ich bin nicht links, ich bin nicht rechts, ich bin unten durch."
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, trininja.

jsledgers reported exactly the same phenomenon 8 weeks ago.

We never got to the bottom of this, because no error messages have ever been posted which could have given any hint as to what might have been wrong.

Explanation:
sdel.cmd or wipe.cmd is a script which calls a console programme, sdelete.exe. Hence, either sdelete or cmd.exe (which executes the script sdel.cmd / wipe.cmd) must display some error message in case they fail. As long as nobody posts such an error message chances are low that the problem will ever be solved.

Kind regards,
Karl
User avatar
trininja
Junior Member
Junior Member
Posts: 21
Joined: 2009-04-07, 22:10 UTC

Post by *trininja »

Well, what I found out is: sdelete.exe wasn't found is the error message, wenn sdelete.exe is in c:\Program Files\totalcmd\ or any deeper directory within the TC folder, the wipe.cmd could be anywhere in the system. I managed to get this message via CMD.

But I found another script that can start sdelete.exe when it is in the TC Folder. I found it over at the Sysinternals forums and did some changes:

Code: Select all

@echo off
:Sets owner to the current loged in User
:FOR %%F IN (%*) DO ECHO Y| icacls %%F /t /c /grant "%username%":f
:Set proper attributes for directories
FOR %%F IN (%*) DO attrib -h -s -r -a %%F /S /D
:Set proper attributes for files
FOR %%F IN (%*) DO attrib -h -s -r -a %%F\*.* /S /D
:3-Pass Deletion
FOR %%F IN (%*) DO "C:\Program Files\totalcmd\Tools\Eraser\sdelete.exe" -p 3 -s %%F
PAUSE
EXIT /b 0
The icalcs line is commented out, because I have to rewrite this line. There are some syntax errors with the original one and I want some different switches and infos.

When this .cmd is in the TC Folder or TC\Tools\Eraser, it won't work and quits with no message. Trying to find the error is little bit complicated, because when I launch the CMD and go into C:\Program Files\totalcmd\Tools\Eraser and start the wipe.cmd with "wipe.cmd C:\test.log" it works, only when I use it as a button in TC, it won't work. Any ideas how I can get the error? The pause command doesn't help.
#153491 - Personal Licence

"Ich geh kaputt, wem darf ich was mitbringen?"

"Ich bin nicht links, ich bin nicht rechts, ich bin unten durch."
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, trininja.
sdelete.exe wasn't found is the error message
This suggests that either of the following reasons applied:
  • sdelete.exe was launched without prefixing the fully qualified foldername, yet sdelete.exe could not be found searching the folders listed in the %PATH% variable.
  • sdelete.exe was launched like this C:\Path\to\sdelete.exe. The path specification enclosed a space character, but was not enclosed in double quotes.
  • sdelete.exe was launched like this C:\Path\to\sdelete.exe. But the given path specification was simply incorrect.
About the other wipe script which you switched to:
when I launch the CMD and go into C:\Program Files\totalcmd\Tools\Eraser and start the wipe.cmd with "wipe.cmd C:\test.log" it works,
This seems to suggest that the script itself is all right and is suitable to its job. :)
When this .cmd is in the TC Folder or TC\Tools\Eraser, it won't work and quits with no message.
Does this mean that even the pause command inside the script does not display its notorious "Press any key to continue ..."? If even this message is not displayed and if you do not have to press a key, then the script does not get launched at all.
This in turn suggests that
  • Something may be wrong with the button configuration which you use to launch wipe.cmd.
    One way of finding out has been explained here: 4th idea. The important thing is to copy and paste the button commandline into a cmd.exe window and find out whether wipe.cmd will be launched.
  • If the above test proves that the commandline to launch wipe.cmd is correct, then it might be that *.cmd is no longer associated with cmd.exe on your Windows system.
    The regkey HKCR\.cmd should specify a default value of "cmdfile".
    The regkey HKCR\cmdfile should have the following subkey: HKCR\cmdfile\shell\open\command. The default value should be "%1" %*.
  • You may also locate wipe.cmd and double click it. It should not do more than display the notorious pause message "Press any key to continue ..." (You migh comment out any destructive commands before double clicking wipe.cmd, just to be sure it will not wipe anything.)
Kind regards,
Karl
User avatar
trininja
Junior Member
Junior Member
Posts: 21
Joined: 2009-04-07, 22:10 UTC

Post by *trininja »

karlchen wrote:Hello, trininja.
sdelete.exe wasn't found is the error message
This suggests that either of the following reasons applied:
  • sdelete.exe was launched without prefixing the fully qualified foldername, yet sdelete.exe could not be found searching the folders listed in the %PATH% variable.
  • sdelete.exe was launched like this C:\Path\to\sdelete.exe. The path specification enclosed a space character, but was not enclosed in double quotes.
  • sdelete.exe was launched like this C:\Path\to\sdelete.exe. But the given path specification was simply incorrect.
To 1: Path was given full like int he other Scripted I used, I used the "" everywhere I should.
To 2: "" where given.
To 3: Checked several times, as you can see, I'm from germany, so I tried C:\Programme and C:\Program Files (Windows Vista) redirects C:\Programme to C:\Program Files.
About the other wipe script which you switched to:
when I launch the CMD and go into C:\Program Files\totalcmd\Tools\Eraser and start the wipe.cmd with "wipe.cmd C:\test.log" it works,
This seems to suggest that the script itself is all right and is suitable to its job. :)
When this .cmd is in the TC Folder or TC\Tools\Eraser, it won't work and quits with no message.
Does this mean that even the pause command inside the script does not display its notorious "Press any key to continue ..."? If even this message is not displayed and if you do not have to press a key, then the script does not get launched at all.
Right, thats what is happening.
This in turn suggests that
  • Something may be wrong with the button configuration which you use to launch wipe.cmd.
    One way of finding out has been explained here: 4th idea. The important thing is to copy and paste the button commandline into a cmd.exe window and find out whether wipe.cmd will be launched.
  • If the above test proves that the commandline to launch wipe.cmd is correct, then it might be that *.cmd is no longer associated with cmd.exe on your Windows system.
    The regkey HKCR\.cmd should specify a default value of "cmdfile".
    The regkey HKCR\cmdfile should have the following subkey: HKCR\cmdfile\shell\open\command. The default value should be "%1" %*.
  • You may also locate wipe.cmd and double click it. It should not do more than display the notorious pause message "Press any key to continue ..." (You migh comment out any destructive commands before double clicking wipe.cmd, just to be sure it will not wipe anything.)
Kind regards,
Karl
The Registry values are all given and work, when I use the command line from TC button in CMD, it gives me the Press any key..., when I start the wipe.cmd with a doubleclick, the Press any key... pops up.

So, now I have to use the wipe.cmd in C:\Batch for my purpose, better than on C:\ but it is no solution in my eyes. Maybe you got another idea.

Kind regards,
Michael
#153491 - Personal Licence

"Ich geh kaputt, wem darf ich was mitbringen?"

"Ich bin nicht links, ich bin nicht rechts, ich bin unten durch."
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, Michael.

I know that we are both from Germany. Funny thing that we are discussing this issue in English. :)

Well, well, the script is fine. The T.C. button commandline is fine. Double quotes are fine.

Seems as if the problem occurs only in case the batch file is located inside a subfolder of "%programfiles%".

So it might be Vista specific, because I cannot reproduce the problem on Windows XP e.g. Yet, on Windows XP, there is either "C:\Program Files" if you are on an English version or "C:\Programme" if you are on a German version. Only on Vista we have got both, "C:\Program Files", the real folder, and "C:\Programme", the symbolic link (or what else is it? Cannot check right now, because I am back on XP at the moment.)

Looks as if I will have to repeat my tests on Vista before I can post another more or less clever idea. :oops:

Cheers,
Karl
Post Reply