cm_CopyNamesToClip question

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

cm_CopyNamesToClip question

Post by *sidefx88 »

Hi guys!

I use the command cm_CopyNamesToClip to copy to the clipboard the selected filenames (name and extension of the file(s)) through a keyboard shortcut assigned.

I'm wondering if TC has also a command to copy to the clipboard ONLY the filename, not the extension. If not, I think that this will be an useful function to add :)

In the meantime: another way to get this working? NirCMD maybe has this function?

Thanks in advance!
I Love Total Commander!
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Button:

Code: Select all

Command: C:\Users\FOO\Documents\AutoHotkey\TC_CopyToClipNamesOnly.ahk

Code: Select all

;;
;; TC_CopyToClipNamesOnly.ahk
;;

ClipBoard:=""
PostMessage, 0x433, 2017,,, A ; cm_CopyNamesToClip
ClipWait
Loop, Parse, ClipBoard, `n
    fileList.=RegExReplace(A_LoopField, "\.[^.]+$") "`n"
ClipBoard:=fileList
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
Gral
Power Member
Power Member
Posts: 1609
Joined: 2005-01-26, 15:12 UTC

Post by *Gral »

OR
Download http://www.petri.co.il/software/clip.zip
extract clip.exe to system32 directory
write simple bat:

Code: Select all

ECHO %1 | CLIP.EXE
put bat on the buttonbar with parameter:

Code: Select all

%O
For older Windows version you can get it from microsoft ftp:
ftp://ftp.microsoft.com/Services/TechNet/samples/PS/Win98/Reskit/FILE/CLIP.EXE

On Windows Vista/7/8 clip.exe should exist out of the box.
Post Reply