\: Incompatible folder path

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
yahuu
Member
Member
Posts: 122
Joined: 2015-01-15, 03:19 UTC

\: Incompatible folder path

Post 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.
License #301983 (2016)
TC 11.51 32+64bit on 10 (21H2) 64bit, 'Everything' 1.5.0.1388a
Autorun 2.2.18.1
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: \: Incompatible folder path

Post by *Fla$her »

And where is the bug if cm_CopyFullNamesToClip copies folder paths with a backslash? That is, you get \\: instead of \:.
Overquoting is evil! 👎
User avatar
yahuu
Member
Member
Posts: 122
Joined: 2015-01-15, 03:19 UTC

Re: \: Incompatible folder path

Post 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.
License #301983 (2016)
TC 11.51 32+64bit on 10 (21H2) 64bit, 'Everything' 1.5.0.1388a
Autorun 2.2.18.1
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: \: Incompatible folder path

Post 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.
Overquoting is evil! 👎
User avatar
yahuu
Member
Member
Posts: 122
Joined: 2015-01-15, 03:19 UTC

Re: \: Incompatible folder path

Post 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.
License #301983 (2016)
TC 11.51 32+64bit on 10 (21H2) 64bit, 'Everything' 1.5.0.1388a
Autorun 2.2.18.1
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: \: Incompatible folder path

Post 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
Or using Autorun

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
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50383
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: \: Incompatible folder path

Post by *ghisler(Author) »

I think the easiest way to handle this is to accept both \: and \\: at the end.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: \: Incompatible folder path

Post by *Fla$her »

I think a lot of this can be done easy.
Overquoting is evil! 👎
Post Reply