Page 1 of 1
\: Incompatible folder path
Posted: 2025-04-16, 08:09 UTC
by yahuu
Code: Select all
[em_LocateItem]
cmd=cd
param=%Z%A\:
If a file path is passed in, \: can go to the parent directory and place the cursor.
But if a folder path is passed in, such as when using the command cm_CopyFullNamesToClip, it will enter the folder, and the last \ from the folder path needs to be manually removed for it to work.
Re: \: Incompatible folder path
Posted: 2025-04-16, 10:00 UTC
by Fla$her
And where is the bug if cm_CopyFullNamesToClip copies folder paths with a backslash? That is, you get \\: instead of \:.
Re: \: Incompatible folder path
Posted: 2025-04-17, 08:44 UTC
by yahuu
The main point is the compatibility issue with \: —when dealing with folder paths, the trailing \ must be manually removed.
Using cm_CopyFullNamesToClip as an example, it demonstrates that paths copied internally in TC (Total Commander) all end with a \.
cd c:\windows\system32\\: will navigate to the c:\windows\system32 , not the c:\windows , and place the cursor on system32.
Re: \: Incompatible folder path
Posted: 2025-04-17, 20:22 UTC
by Fla$her
yahuu wrote: 2025-04-17, 08:44 UTC
the trailing \ must be manually removed.
You manually insert the path. Why not do something else manually? ¯\_(ツ)_/¯
yahuu wrote: 2025-04-17, 08:44 UTCend with a \.
See
suggestions.
Re: \: Incompatible folder path
Posted: 2025-04-20, 13:41 UTC
by yahuu
Fla$her wrote: 2025-04-17, 20:22 UTC
You manually insert the path. Why not do something else manually? ¯\_(ツ)_/¯
Of course, it can be handled manually, but it would be even better if TC itself is compatible.
\: It does not support folder paths copied from TC's own commands, which I find unreasonable.
Re: \: Incompatible folder path
Posted: 2025-04-20, 14:09 UTC
by Fla$her
No one knows where and for what purposes you are copying the folder path. The addition "\:" has not adapted to clipboard commands, if only because they are not limited to a single list item.
I understand that you want a universal option for a file and folder, but it has nothing to do with bugs anyway.
Maybe you should copy names without trailing (back)slashes? Example:
Code: Select all
TOTALCMD#BAR#DATA
mshta.exe "javascript:with(new ActiveXObject('Scripting.FileSystemObject')){clipboardData.setData('text',
openTextFile(getSpecialFolder(2)+'\\'+'%WL'.replace(/.+(?=CMD\w+\.tmp$)/,''),1,0,-1).readAll().slice(0,-2).replace(/[/\\](?=\r|$)/g,''))};close()"
wcmicon2.dll,45
Copy full names without trailing (back)slash
1
Code: Select all
# cm_CopyNamesToClipNS
RegisterCommand 80000 CopyNamesWithoutTrailingSlash
# cm_CopyFullNamesToClipNS
RegisterCommand 80001 CopyNamesWithoutTrailingSlash 1
# cm_CopyNetNamesToClipNS
RegisterCommand 80002 CopyNamesWithoutTrailingSlash 4
# cm_CopyPathOfFilesToClipNS
RegisterCommand 80003 CopyNamesWithoutTrailingSlash 1018
Func CopyNamesWithoutTrailingSlash(lParam, Opt=0)
SendCommand(2017 + Opt, 0, 1)
Local Clip = ClipGet()
If Clip <> '' Then
If StrPos('\/', StrRight(Clip, 1)) Then Clip = StrLeft(Clip, StrLen(Clip) - 1)
If StrPos(Clip, '\') Then
ClipPut(StrReplace(Clip, '\' & auCR, auCR))
ElseIf StrPos(Clip, '/') Then
ClipPut(StrReplace(Clip, '/' & auCR, auCR))
EndIf
EndIf
EndFunc
Re: \: Incompatible folder path
Posted: 2025-04-25, 08:20 UTC
by ghisler(Author)
I think the easiest way to handle this is to accept both \: and \\: at the end.
Re: \: Incompatible folder path
Posted: 2025-04-25, 08:56 UTC
by Fla$her
I think a lot of
this can be done easy.