How to import clipping items into the path editing bar
Moderators: Hacker, petermad, Stefan2, white
How to import clipping items into the path editing bar
How to import clipping items into the path editing bar, I want to implement this combined command, cmd=cm_EditPath,Ctrl+V, how to write this command Ctrl+V
Re: How to import clipping items into the path editing bar
2xxxdo1
Unfortunately, a few tests I ran with the following compound commands were NOT successful:
cm_EditPath,CM_WAIT 750,cm_PasteFromClipboard,cm_Return
The explanations of the individual commands can be displayed in the CommandBrowser (command: cm_CommandBrowser).
This tool is required: NirSoft utilities 2.8.7.232 - 23.4.2024 | Download links at the very bottom...
I use this solution, too: solution in the German forum.
With regard to Horst.Epp's solution, I would like to add that the em_command must be added to the usercmd.ini file.
If this file does not yet exist, it must be created using a text editor in the directory in which the
TOTALCMD.EXE and/or TOTALCMD64.EXE files are located. This path also corresponds to %COMMANDER_PATH%.
Windows 11 Pro (x64) Version 23H2 (OS Build 22631.4391) | TC 11.50b4 x64/x86
CTRL+V ... cm_PasteFromClipboard 2009 Paste from clipboard to current dir
Unfortunately, a few tests I ran with the following compound commands were NOT successful:
cm_EditPath,CM_WAIT 750,cm_PasteFromClipboard,cm_Return
The explanations of the individual commands can be displayed in the CommandBrowser (command: cm_CommandBrowser).
In this post, there is a solution from user Horst.Epp.
This tool is required: NirSoft utilities 2.8.7.232 - 23.4.2024 | Download links at the very bottom...
I use this solution, too: solution in the German forum.
With regard to Horst.Epp's solution, I would like to add that the em_command must be added to the usercmd.ini file.
If this file does not yet exist, it must be created using a text editor in the directory in which the
TOTALCMD.EXE and/or TOTALCMD64.EXE files are located. This path also corresponds to %COMMANDER_PATH%.
Hint: Create a Button in the BUTTONBAR (copy/paste CODE)
- Click on "SELECT ALL" (to the right of CODE:), then press CTRL+C (copy to clipboard).
- Right-click on any place in the button bar, then click on "Paste".
⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺ - Option1: Point to the new button (slightly longer): 'Tooltip' is shown (-> description to the button).
A maximum of 259 characters is allowed for the tooltip. | = create line break, || = create | as separator character. - Option2: Button bar - "Tooltip" field: A single space deactivates the display of the tooltip.
If the "Tooltip" field is empty, the content of the "Command" field is displayed. - Option3: See FAQs and explanation: Button-code (TOTALCMD#BAR#DATA) <-- <Ctrl+click on the link...>
Windows 11 Pro (x64) Version 23H2 (OS Build 22631.4391) | TC 11.50b4 x64/x86
Re: How to import clipping items into the path editing bar
Who says it is not successful? You yourself say that cm_PasteFromClipboard is for pasting to the current dir, so to the active file panel in TC. Does it not paste the file (note that this is different than a filename) currently on the clipboard to current dir?
Re: How to import clipping items into the path editing bar
2xxxdo1
Why paste the contents of the clipboard into this field? Do you want to navigate to objects by their paths? Then using this field is unnecessary. I have a smart script that finds the first path, ignoring the extra characters. It works with different types of paths supported by TC (local, GUID, keys for registry plugins). I can share it.
Something similar could be done in the Autorun plugin, but unfortunately there is no RegExp function yet, so parsing will be more difficult.
Why paste the contents of the clipboard into this field? Do you want to navigate to objects by their paths? Then using this field is unnecessary. I have a smart script that finds the first path, ignoring the extra characters. It works with different types of paths supported by TC (local, GUID, keys for registry plugins). I can share it.
Something similar could be done in the Autorun plugin, but unfortunately there is no RegExp function yet, so parsing will be more difficult.
Overquoting is evil! 👎
Re: How to import clipping items into the path editing bar
Yes, I want to paste the path I just copied in the path editing bar and navigate to the object. I want to make it a compound command. Can I do this with a compound command?
Please share your script. I want to learn it.
Last edited by xxxdo1 on 2024-11-03, 18:41 UTC, edited 1 time in total.
Re: How to import clipping items into the path editing bar
My goal was the following, which I can achieve with the solution from Horst.Epp
1. If there is a path in the clipboard, you can change to this directory *in the active TC window* with ALT+V or click on the button
2. If there is a path and file name in the clipboard, you can change to this directory *in the active TC window* with ALT+V or
click on the button AND the cursor is positioned on the file name(!).
With the combined commands as indicated, the path of the folder on which the cursor is positioned is used
instead of the contents of the clipboard. Maybe someone still knows a solution for combined commands...
In my opinion, xxxdo1 also has this goal:
Yes, I want to paste the path I just copied in the path editing bar and navigate to the object. ...
Have you tried Horst.Epp's solution yet?
Last edited by tuska on 2024-11-03, 19:47 UTC, edited 1 time in total.
Re: How to import clipping items into the path editing bar
TCNavigatorByPathFromClipboard.vbs (save with ANSI/UTF-16, create a em_command/button with the script path and specified param's):
Code: Select all
'——————————————————————————————— VBS ———————————————————————————————
' Assignment: Smart navigating to an object in the active panel by
' file/folder name, registry key, or GUID specified in the clipboard
' Parameters: "<name of the registry plugin in wfx-list>" "%P%Z"
'———————————————————————————————— Author: Flasher (11.08.2013) © ———
Option Explicit: Dim oWSH, oFSO, R, A, C, oREx, F
Const Title = " Navigating a path in the TC panel"
If WSH.Arguments.Count <> 2 Then MsgBox "Specify two parameters!", 262192, Title: WSH.Quit
Set oWSH = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
R = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1407"
A = oWSH.RegRead(R): If A > 0 Or Err.Number <> 0 Then oWSH.RegWrite R, 0, "REG_DWORD"
C = CreateObject("htmlfile").ParentWindow.ClipboardData.GetData("text")
If A > 0 Then oWSH.RegWrite R, A, "REG_DWORD"
On Error Goto 0: If Len(C) = 0 Then Quit 0
Set oREx = New RegExp
With oREx
.IgnoreCase = 1
.Pattern = "(H[CK]|(::)?\{|%|[A-Z]:)[^\r\n""]+[^\s\\""]"
If .Test(C) Then
C = .Execute(C)(0)
Else .Pattern = " *[^\s/|:\\<*?>""][^\r\n\t|:<*?>""]*"
If .Test(C) Then C = RTrim(.Execute(C)(0)) Else Quit 1
End If : .Pattern = "^(::)?\{"
End With
C = Replace(Replace(Replace(C, " \ ", "\"), " / ", "/"), """", "")
If InStr(1, "|HK|HC|", "|" & Left(C, 2) & "|", 1) Then
If Right(C, 1) = "]" Then C = Left(C, Len(C) - 1)
R = InStr(C, ":") : If R = 4 Or R = 5 Then _
C = Left(C, R - 1) & Mid(C, R + 1)
C = oFSO.BuildPath(Replace(C, "/", "\"), "\")
Select Case UCase(Left(C, InStr(C, "\") - 1))
Case "HKCU" C = "HKEY_CURRENT_USER" & Mid(C, 5)
Case "HKLM" C = "HKEY_LOCAL_MACHINE" & Mid(C, 5)
Case "HKCR" C = "HKEY_CLASSES_ROOT" & Mid(C, 5)
Case "HKCC" C = "HKEY_CURRENT_CONFIG" & Mid(C, 5)
Case "HKU" C = "HKEY_USERS" & Mid(C, 4)
End Select : On Error Resume Next : oWSH.RegRead(C)
Do Until Err.Number = 0
On Error Goto 0
If InStr(C, "\") = Len(C) Then Exit Do
C = oFSO.GetParentFolderName(C) & "\"
On Error Resume Next : oWSH.RegRead(C)
Loop : C = "\\\" & WSH.Arguments(0) & "\" & C
ElseIf Not oREx.Test(C) Then
oREx.Pattern = "^(%|[A-Z]:)?[^:?*<|>]+"
If oREx.Test(C) Then C = oWSH.ExpandEnvironmentStrings(oREx.Execute(C)(0)) Else Quit 1
oREx.Pattern = ".+/.+\\.+|.+\\.+/.+" : If oREx.Test(C) Then _
oREx.Pattern = "(.+)[\\/][^\\/]+[\\/]?$" :_
If oREx.Test(C) Then Set C = oREx.Execute(C)(0) :_
If oFSO.FolderExists("\\?\" & C) + oFSO.FileExists("\\?\" & C) = 0 Then C = C.Submatches(0)
If Mid(C, 2, 1) = ":" Then
F = Left(C, Len(C) - 1)
If oFSO.FileExists("\\?\" & C) + oFSO.FolderExists("\\?\" & C) = 0 Then _
If oFSO.FileExists("\\?\" & F) + oFSO.FolderExists("\\?\" & F) < 0 Then C = F
Else
C = WSH.Arguments(1) & C
If oFSO.FileExists("\\?\" & C) + oFSO.FolderExists("\\?\" & C) = 0 Then
For R = 3 To UBound(Split(Replace(C, "/", "\"), "\"))
If oFSO.FolderExists("\\?\" & C) Then R = 0 : Exit For Else C = oFSO.GetParentFolderName(C)
Next : If R Then Quit 1
End If
End If
If StrComp(oFSO.BuildPath(C, "\"), WSH.Arguments(1), 1) = 0 Then Quit 0
If oFSO.FolderExists("\\?\" & C) + oFSO.FileExists("\\?\" & C) = 0 Then Quit 1 Else C = C & "\:"
Else On Error Resume Next
If Left(C, 1) = "{" Then C = "::" & C
If CreateObject("Shell.Application").NameSpace("shell:" & C) Is Nothing Then Quit 1
If Err Then Quit 1
End If
If StrComp(oFSO.BuildPath(C, "\"), WSH.Arguments(1), 1) = 0 Then Quit 0
oWSH.Sendkeys "^{F10}": oWSH.Run """%COMMANDER_EXE%"" /A /O /S """ & C & """": Quit 0
Sub Quit(T)
If T Then MsgBox "The contents of the clipboard are not equivalent" & vbCr &_
"to an existing path in the system or registry !", 262192, Space(24) & Title
Set oFSO = Nothing: Set oWSH = Nothing: Set oREx = Nothing: WSH.Quit
End Sub
- If both slashes are present in the path to the missing directory/file, the parent folder will become the object to be navigated.
- Registry keys can be written as abbreviations (HKCU, HKCR, HKLM, HKCC, HCU) in any register and have ':' at the end.
- If a parameter or a non-existent registry key is specified, it will jump to an existing hive in the path chain.
- The separator in the path chain can be a forward or back slash, including those with extra spaces on both sides.
- Long paths (more than 259 characters), relative paths, and paths with environment variables are supported.
- Extra trailing spaces, tabs, line breaks, quotation marks, square brackets can be indicated.
- In the relative path chain, all constituent components are also checked for presence.
- Forbidden characters at the end of file and directory paths are trimmed.
- A virtual directory can be opened by {GUID} or ::{GUID}.
Last edited by Fla$her on 2024-11-05, 00:55 UTC, edited 3 times in total.
Overquoting is evil! 👎
Re: How to import clipping items into the path editing bar
Thank you, I tried Horst.Epp's solution, but it's still not very concise to use NirCmd.exe.
I found a simpler way, using TCIMG.exe, which contains more commands.
http://tcimg.dreamlair.net/TCIMG_ONLINE.html
Code: Select all
cmd=cd TCIMG.exe clpget
Re: How to import clipping items into the path editing bar
2xxxdo1
It's not clear who you're addressing. When contacting, it uses a nickname insertion instead of an empty quotation.
The simple way is not yet the smart way. Try my script and feel the difference.
It's not clear who you're addressing. When contacting, it uses a nickname insertion instead of an empty quotation.
The simple way is not yet the smart way. Try my script and feel the difference.
Overquoting is evil! 👎
Re: How to import clipping items into the path editing bar
Just out of interest, I briefly tested the .vb script (using “wfx_registry_5.2”):
I can also get the functions I mentioned above (“my goal...” ) with this script and the plugin, but...
With a path >259 characters you get this hint with the.vb script:
(Other.lnk files work with the .vb script!).
These issues do not present an obstacle in the NirSoft utilities solution.
After user xxxdo1 has found a solution for himself, the issue is closed for me.
I can also get the functions I mentioned above (“my goal...” ) with this script and the plugin, but...
With a path >259 characters you get this hint with the.vb script:
A .lnk file (to OneDrive), for example, brings up this message:Navigating a path in the TC panel
Specify two parameters!
The path and the goal exist!Navigating a path in the TC panel
The contents of the clipboard are not equivalent
to an existing path in the system or registry !
(Other.lnk files work with the .vb script!).
These issues do not present an obstacle in the NirSoft utilities solution.
After user xxxdo1 has found a solution for himself, the issue is closed for me.
Re: How to import clipping items into the path editing bar
Unconfirmed. What parameters did you specify?
This is strange. Can I see the full name of lnk?
Choosing a tool is more important than someone else's issues, don't you think?
Overquoting is evil! 👎
Re: How to import clipping items into the path editing bar
The problem occurs when I want to insert the clipboard contents into a path in the 'path editing bar'
that already has more than 259 characters.
BUTTON with em_TCNavigatorByPathFromClipboard
Code: Select all
TOTALCMD#BAR#DATA
em_TCNavigatorByPathFromClipboard
wciconex.dll
em_TCNavigatorByPathFromClipboard || wfx_registry_5.2|https://www.ghisler.ch/board/viewtopic.php?p=463015#p463015|How to import clipping items into the path editing bar
-1
%COMMANDER_PATH%\usercmd.ini
Code: Select all
[em_TCNavigatorByPathFromClipboard]
button=
cmd=%COMMANDER_PATH%\Tools\Skripts\TCNavigatorByPathFromClipboard.vbs
param=""%COMMANDER_PATH%\Plugins\wfx\Registry" "%P%Z""
menu=%COMMANDER_PATH%\Tools\Skripts\TCNavigatorByPathFromClipboard.vbs|Parameters: "%COMMANDER_PATH%\Plugins\wfx\Registry" "%P%Z"|https://www.ghisler.ch/board/viewtopic.php?p=463015#p463015
Re: How to import clipping items into the path editing bar
File: _OneDrive_%USERPROFILE%-OneDrive_redirected to_D-Daten-OneDrive.lnk
Properties (user = my-username):
- Target: C:\Users\user\OneDrive
- Execute in: C:\Users\user
When I click on the shortcut (.lnk), the following path is called up on my PC: D:\Daten\OneDrive\ .
Please don't ask me how I set it up back then (I'm just a hobby user).