Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wipe files using sdelete ?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) Printable version
View previous topic :: View next topic  
Author Message
Clo
Moderator
Moderator


Joined: 02 Dec 2003
Posts: 5737
Location: Bordeaux, France

PostPosted: Wed Feb 25, 2009 3:16 pm    Post subject: Not patient, but --- Reply with quote

2karlchen

Smile Hi Karl !

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

Mr. Green VG
Claude
Clo
_________________
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
karlchen
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 4249
Location: Germany

PostPosted: Wed Feb 25, 2009 3:47 pm    Post subject: [OT] RE: Not patient, but --- Reply with quote

Hi, Clo.

You are right and I am a lazybones. Laughing
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
Back to top
View user's profile Send private message Send e-mail
trininja
Junior Member
Junior Member


Joined: 07 Apr 2009
Posts: 19

PostPosted: Sun Apr 12, 2009 10:52 am    Post subject: Reply with quote

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."
Back to top
View user's profile Send private message
karlchen
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 4249
Location: Germany

PostPosted: Sun Apr 12, 2009 3:39 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
trininja
Junior Member
Junior Member


Joined: 07 Apr 2009
Posts: 19

PostPosted: Mon Apr 13, 2009 3:40 am    Post subject: Reply with quote

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:

@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."
Back to top
View user's profile Send private message
karlchen
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 4249
Location: Germany

PostPosted: Mon Apr 13, 2009 5:16 am    Post subject: Reply with quote

Hello, trininja.

Quote:
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:
Quote:
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. Smile
Quote:
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
Back to top
View user's profile Send private message Send e-mail
trininja
Junior Member
Junior Member


Joined: 07 Apr 2009
Posts: 19

PostPosted: Mon Apr 13, 2009 6:31 am    Post subject: Reply with quote

karlchen wrote:
Hello, trininja.

Quote:
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.

Quote:

About the other wipe script which you switched to:
Quote:
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. Smile
Quote:
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.

Quote:

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."
Back to top
View user's profile Send private message
karlchen
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 4249
Location: Germany

PostPosted: Mon Apr 13, 2009 3:24 pm    Post subject: Reply with quote

Hello, Michael.

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

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. Embarassed

Cheers,
Karl
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group