Get current directory in max 2 clicks

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
awa5114
Junior Member
Junior Member
Posts: 3
Joined: 2019-07-02, 13:57 UTC

Get current directory in max 2 clicks

Post by *awa5114 »

Is there any way to just get the current directory using Total Commander? Using Mark>Copy names with path to clipboard I get the path but it includes the filename, which I must subsequently delete whenever I paste the path elsewhere. To circumvent this, one must go up to the parent directory, select it and then go to Mark>Copy names with path to clipboard. Then one must navigate back into the directory they were already in. In windows explorer this can be achieved with one click and then Ctrl+C.

Is there any way to get the current directory using the Total Commander, preferably in 2 clicks or less? Thanks!
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Get current directory in max 2 clicks

Post by *Stefan2 »

There are a few ways.

For example, try clicking into the address bar to make it editable and copy that.




@all: what other ways do you use?


 
awa5114
Junior Member
Junior Member
Posts: 3
Joined: 2019-07-02, 13:57 UTC

Re: Get current directory in max 2 clicks

Post by *awa5114 »

Yes, that does the trick. It is similar to windows explorer in a way then. Just you have to wait between the two clicks in the address bar. Similar to a file rename.

I think this will work for me.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Get current directory in max 2 clicks

Post by *Hacker »

Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Get current directory in max 2 clicks

Post by *Stefan2 »

Mark>Copy names with path to clipboard
>>>> x:\totalcmd\TOTALCMD.INC >>> cm_CopyFullNamesToClip=2018;Copy names with full path



And there in TOTALCMD.INC is f.ex. too:
cm_CopySrcPathToClip=2029;Copy source path to clipboard
cm_CopyTrgPathToClip=2030;Copy target path to clipboard


So you can use cm_CopySrcPathToClip as command for an button.
Or for a "user defined command", which you can also use as command for an button and also create an keyboard shortcut to.





 
Ralph
Junior Member
Junior Member
Posts: 97
Joined: 2004-08-21, 14:58 UTC
Location: USA

Re: Get current directory in max 2 clicks

Post by *Ralph »

Can a backslash be appended automatically to the path?
For example, I want to paste the path the left of a filename for use in a File Open dialog box. If the folder is
D:\folder\
and I use cm_CopySrcPathToClip, the clipboard will contain
D:\folder

Thanks
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Get current directory in max 2 clicks

Post by *Stefan2 »

Ralph wrote: 2019-07-23, 00:31 UTC Can a backslash be appended automatically to the path?
For example, I want to paste the path the left of a filename for use in a File Open dialog box. If the folder is
D:\folder\
and I use cm_CopySrcPathToClip, the clipboard will contain
D:\folder

Thanks
Not on default or with an option, but with utilizing an external tool.

; FAQs: automate/script TC with AutoHotkey AHK
; viewtopic.php?p=350976#p350976
;
; FAQs: How to create an button
; viewtopic.php?p=344803#p344803
;
; FAQs: Button-code: How-to Copy Share Paste a button ('TOTALCMD#BAR#DATA')
; viewtopic.php?p=335879#p335879
;
; FAQs: Button - How to execute more than one command at once
; viewtopic.php?p=287794#p287794
;
; FAQs: User-Defined Command (UDC) (usercmd.ini) em_command
; viewtopic.php?p=344777#p344777
;
; FAQs: TCs' internal commands - how-to find and use them
; viewtopic.php?p=289931#p289931




A AutoHotkey script to add a trailing backslash to the clipboard content, after executing cm_CopySrcPathToClip (which is 2029):

In short:
SendMessage 1075, 2029, 0, , ahk_class TTOTAL_CMD
clipboard = %clipboard%\


Result:
Have "d:\folder\" in clipboard instead of "d:\folder" only.



Or long version:
myVar = %clipboard%
msgbox % myVar
myVarOut = %myVar%\
msgbox % myVarOut
clipboard = %myVarOut%


Code: Select all

#SingleInstance, Force
#IfWinExist, ahk_class TTOTAL_CMD

; https://ghisler.ch/board/viewtopic.php?p=357697#p357697

; ===========================================
; TC-Button
; Command: "D:\rive\path to\AutoHotkey.exe" "D:\rive\path to\this script.ahk"
; Parameters:
; Start path:
; Icon: "D:\rive\path to\AutoHotkey.exe"
; Tooltip: cm_CopySrcPathToClip with trailing backslash
;
; FAQs: automate/script TC with AutoHotkey AHK
; https://ghisler.ch/board/viewtopic.php?p=350976#p350976
;
; FAQs: How to create an button
; https://ghisler.ch/board/viewtopic.php?p=344803#p344803
; 
; FAQs: Button-code: How-to Copy Share Paste a button ('TOTALCMD#BAR#DATA')
; https://ghisler.ch/board/viewtopic.php?p=335879#p335879
; 
; FAQs: Button - How to execute more than one command at once
; https://ghisler.ch/board/viewtopic.php?p=287794#p287794
; 
; FAQs: User-Defined Command (UDC) (usercmd.ini) em_command
; https://ghisler.ch/board/viewtopic.php?p=344777#p344777
; 
; FAQs: TCs' internal commands - how-to find and use them
; https://ghisler.ch/board/viewtopic.php?p=289931#p289931


; ===========================================
; c:\totalcmd\TOTALCMD.INC == TC-internal commands
; [________________Clipboard________________]=0
; cm_CutToClipboard=2007;Cut selected files to clipboard
; cm_CopyToClipboard=2008;Copy selected files to clipboard
; cm_PasteFromClipboard=2009;Paste from clipboard to current dir
; cm_CopyNamesToClip=2017;Copy filenames to clipboard
; cm_CopyFullNamesToClip=2018;Copy names with full path
; cm_CopyNetNamesToClip=2021;Copy names with UNC path
; cm_CopySrcPathToClip=2029;Copy source path to clipboard
; cm_CopyTrgPathToClip=2030;Copy target path to clipboard
; cm_CopyFileDetailsToClip=2036;Copy all shown columns
; cm_CopyFpFileDetailsToClip=2037;Copy all columns, with full path
; cm_CopyNetFileDetailsToClip=2038;Copy all columns, with UNC path
; ===========================================

;Send a TC-internal command (here 2029) to the running TC.exe:
SendMessage 1075, 2029, 0, , ahk_class TTOTAL_CMD

ClipWait
clipboard = %clipboard%\

EXITApp



 
User avatar
vdijken
Member
Member
Posts: 181
Joined: 2016-07-30, 14:07 UTC
Location: The Netherlands

Re: Get current directory in max 2 clicks

Post by *vdijken »

Make in the button bar a new entry with as command C:\Windows\System32\cmd.exe. Make a icon. When you click on it you go straight to the current directory.
Post Reply