Button bar: Delete (no recycle), Empty recycle, New file?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Vesna_Cro
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-29, 11:12 UTC
Location: Croatia

Button bar: Delete (no recycle), Empty recycle, New file?

Post by *Vesna_Cro »

Hi,

I searched the forum and web but cannot find how to add buttons to button bar that would perform these operations:

- delete selected file(s)/folder(s) without moving them to recycle bin (I already use basic delete button but would like to have also alternative button like this) and to have the function like cm_Delete so I can drop files/foldewr on it
- empty recycle bin (no confirmation)
- create new empty file with name to be entered before creation (not to create it named 'newfile' but with the name I write

Hope someone can help with these.

Thank you.
--
Vesna
bobputnam
Junior Member
Junior Member
Posts: 77
Joined: 2003-05-26, 12:31 UTC
Location: Connecticut, USA

Post by *bobputnam »

Here is a program that you can assign to a button to empty the recycle bin.

http://www.optimumx.com/Download/#EmptyRecycleBin
Bob P
3-User License 71012
User avatar
Sombra
Power Member
Power Member
Posts: 814
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Post by *Sombra »

Hello,
- delete selected file(s)/folder(s) without moving them to recycle bin (I already use basic delete button but would like to have also alternative button like this)
Paste the next code in you toolbar. -it has some little bug, but it works. Beware with the next command, it delete selected files and folder without confirmation and they are not moved to the recycle bin.

Code: Select all

TOTALCMD#BAR#DATA
%ComSpec%
/c for %%F in (%S) do rd /s /q %%F & erase /f /s /q %%F
shell32.dll,131
Delete without confirmation


-1
and to have the function like cm_Delete so I can drop files/foldewr on it
Drag your files/folders while SHIFT is pressed to the F8 function button.
empty recycle bin (no confirmation)
You can to use Nircmd for this purpose, make a button with the command: <path>nircmd.exe emptybin
create new empty file with name to be entered before creation (not to create it named 'newfile' but with the name I write
You can use AHK:

Code: Select all

IfWinActive, ahk_class TTOTAL_CMD
{
Send +{F4}
}
Or an alternative solution without AHK here

HTH
I can read English, but... I write like Tarzan. (sorry)
Vesna_Cro
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-29, 11:12 UTC
Location: Croatia

Post by *Vesna_Cro »

Sombra wrote: Paste the next code in you toolbar. -it has some little bug, but it works. Beware with the next command, it delete selected files and folder without confirmation and they are not moved to the recycle bin.

Code: Select all

TOTALCMD#BAR#DATA
%ComSpec%
/c for %%F in (%S) do rd /s /q %%F & erase /f /s /q %%F
shell32.dll,131
Delete without confirmation


-1
I pasted it and icon shows up but if i select a file and click this new button for small part of second black dos windows opens and closes, but not for enough time for me to see what error it displays (file is not deleted).
Could be an error in empty lines in code or something? I have no knowledge of this coding, hope you can help some more with this code?
empty recycle bin (no confirmation)

You can to use Nircmd for this purpose, make a button with the command: <path>nircmd.exe emptybin
thank you for this, really usefull little exe, i added some more buttons with it (opening CD-ROM, turning off monitor, PC, taking screenshot after x seconds and similar :) )
create new empty file with name to be entered before creation (not to create it named 'newfile' but with the name I write
Hm, I will stay with right click-new file because none of suggestions asks me for filename before creating it. :( I am trying to avoid any extra clicks because I have painfull hands :(
--
Vesna
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

not for enough time for me to see what error it displays
For testing pupose, you can add a pause command like:

Code: Select all

/c for %%F in (%S) do rd /s /q %%F & erase /f /s /q %%F & pause
Which windows version are you using ?
#5767 Personal license
Vesna_Cro
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-29, 11:12 UTC
Location: Croatia

Post by *Vesna_Cro »

pause doesn't help, I try to look but it seems (not sure) dos window is actually empty.

i use win xp.
--
Vesna
User avatar
Sombra
Power Member
Power Member
Posts: 814
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Post by *Sombra »

Hmmmhh... I have tested it in win xp and works fine (even with pause suggested by sqa_wizard.
Be sure to write the next strings in bold inside configuration for your button:
Command: %comspec% (or command.com or cmd.exe)
Parameters: /c for %%F in (%S) do rd /s /q %%F & erase /f /s /q %%F
An alternative way for remain open the dos box is changing /c by /k
hank you for this, really usefull little exe, i added some more buttons
Glad to hear :)
I will stay with right click-new file because none of suggestions asks me for filename before creating it.
For the AHK code is necessary to have installed Autohotkey
Also you can use SHIFT+F4 (without button) name is suggested but it is autoselected and will be overwrite with text that you write.
HTH
I can read English, but... I write like Tarzan. (sorry)
Vesna_Cro
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-29, 11:12 UTC
Location: Croatia

Post by *Vesna_Cro »

Sombra wrote: An alternative way for remain open the dos box is changing /c by /k
Yes, I have checked the code again, evberything pasted ok.
Now I changed /c to /k and i see in dos window only path to folder where I am is displayed, nothing happens, nothing gets deleted.
Also you can use SHIFT+F4 (without button) name is suggested but it is autoselected and will be overwrite with text that you write.
can this shortcut be turned into button? this is exactly what I want but on a button, trying to avoid keyboard use. And can opening the Notepad be avoided? just need file created, no editing, opening of it.
--
Vesna
User avatar
HolgerK
Power Member
Power Member
Posts: 5411
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Vesna_Cro wrote:SHIF+F4 ... can this shortcut be turned into button? this is exactly what I want but on a button, trying to avoid keyboard use. And can opening the Notepad be avoided? just need file created, no editing, opening of it.

Code: Select all

TOTALCMD#BAR#DATA
%comspec% /c copy nul:
?new.txt
WCMICONS.DLL,28
new empty file


-1
HTH,
Holger
Vesna_Cro
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-29, 11:12 UTC
Location: Croatia

Post by *Vesna_Cro »

HolgerK wrote:SHIF+F4 ... can this shortcut be turned into button?
this was fast, thank you!

now only to solve that delete code.
--
Vesna
User avatar
HolgerK
Power Member
Power Member
Posts: 5411
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

/c for %%F in (%S) do rd /s /q %%F & erase /f /s /q %%F
I didn't test it, but %S (capital) puts long names into the command line.
May be some problems with non 7Bit US-ASCII characters.
Try to replace %S with %s (lower case).
There should be no problems with DOS-(8.3) short names.

HTH,
Holger
Vesna_Cro
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-29, 11:12 UTC
Location: Croatia

Post by *Vesna_Cro »

HolgerK wrote:
/c for %%F in (%S) do rd /s /q %%F & erase /f /s /q %%F
I didn't test it, but %S (capital) puts long names into the command line.
May be some problems with non 7Bit US-ASCII characters.
Try to replace %S with %s (lower case).
still same result: only full path to folder where i am located is displayed (long names still even tough I replaced %S with %s.
No visible delete or erase command, only path displayed. :(
--
Vesna
User avatar
HolgerK
Power Member
Power Member
Posts: 5411
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Did you mark files or folders, or did you place the cursor on a file or folder, before hitting the button?

The only way, I can reproduce the described behavior, is when no files or folders are marked and the cursor is placed on the [..] list entry.

HTH,
Holger
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

May we missed one important fact: Which TC version are you using ?
The %S parameter has been introduced with 7.0 ...

If your version is less, you should update to the latest one (7.04a) ... for free as usual.
#5767 Personal license
Vesna_Cro
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-29, 11:12 UTC
Location: Croatia

Post by *Vesna_Cro »

I installed new tcmd 7.01 and it works but too much!!! ;)

this is the code:
/c for %%F in (%S) do rd /s /q %%F & erase /f /s /q %%F

i selected one jpg file which i had in 3 places on my comp (jpg in 3 sizes, always same filename) and it deleted it in all 3 places?!

e:/test.jpg
e:/images/test.jpg
e:/desktop/test.jpg

???
--
Vesna
Post Reply