Button: "Path not found" on path with squared bracket [...]

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
blablaalb
Junior Member
Junior Member
Posts: 14
Joined: 2018-11-25, 15:37 UTC

Button: "Path not found" on path with squared bracket [...]

Post by *blablaalb »

So, the problem I'm facing isn't actually related to the Total Commander, but I hope I still can get some help.
I have a button set up on the top bar that launches Windows Terminal. In order to launch the Windows Terminal in the current directory I use the -d %P parameter. The problem is that sometimes I get the
[error 0x80070002 when launching
error. For example I can easily launch Windows Terminal in the c:\Users\blablaalb\Desktop\ directory, but it fails to launch in the d:\Courses\[ FreeCourseWeb.com ] Udemy - x86 Assembly Language From Ground Up\ Image: https://i.ibb.co/sv2R7qF/image.png I think I get the error because of not escaping spaces and other special character in the path? How can I fix that?

P.S. Can I insert inline code here in the editor?
blablaalb
Junior Member
Junior Member
Posts: 14
Joined: 2018-11-25, 15:37 UTC

Re: Path not found

Post by *blablaalb »

Inserting path with the quotation marks "-d %P" results in

Code: Select all

[error 0x8007010b when launching `powershell.exe']
Could not access starting directory "d:\Courses\[ FreeCourseWeb.com ] Udemy - x86 Assembly Language From Ground Up\~Get Your Course Here !""
If I escape the last quotation mark "-d %P\" the Terminal launches in the PS C:\Windows\System32\WindowsPowerShell\v1.0> directory Image: https://i.ibb.co/SngqZ9r/image.png
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Path not found

Post by *Dalai »

Does it work from a running CMD window with the exact same parameters? I suggest to log the whole thing with Process Monitor to be able to see what exactly is being executed.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
blablaalb
Junior Member
Junior Member
Posts: 14
Joined: 2018-11-25, 15:37 UTC

Re: Path not found

Post by *blablaalb »

Dalai wrote: 2021-07-31, 11:40 UTC Does it work from a running CMD window with the exact same parameters? I suggest to log the whole thing with Process Monitor to be able to see what exactly is being executed.

Regards
Dalai
It doesn't work even when I try to change directory (CD) from the console Image: https://i.ibb.co/2NySw2Q/image.png I think I might need to somehow escape character in the path, but I have no idea how to do it.
The cm_ExecuteDOS command opens cmd in the directory without any issue. Image: https://i.ibb.co/K9G2D7n/image.png
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Path not found

Post by *Dalai »

Did you copy and paste the path into the PowerShell? Or did you use path completion?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
blablaalb
Junior Member
Junior Member
Posts: 14
Joined: 2018-11-25, 15:37 UTC

Re: Path not found

Post by *blablaalb »

I copied and pasted the entire path from total commander Image: https://i.ibb.co/c8N6hJp/Animation.gif
It doesn't work even if I remove the last slash character from the path.
blablaalb
Junior Member
Junior Member
Posts: 14
Joined: 2018-11-25, 15:37 UTC

Re: Path not found

Post by *blablaalb »

Ok, so I tried to use autocompletion and it escaped the [ ] characters. The working path would be
"D:\Courses\``[ FreeCourseWeb.com ``] Udemy - x86 Assembly Language From Ground Up\~Get Your Course Here !\"
I should have escaped the square brackets with `` characters, wrapping the path in quotation marks wasn't enough.
Last edited by blablaalb on 2021-07-31, 12:38 UTC, edited 1 time in total.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Path not found

Post by *Dalai »

Perhaps it works when using single quotes like

Code: Select all

cd 'path_here'
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
blablaalb
Junior Member
Junior Member
Posts: 14
Joined: 2018-11-25, 15:37 UTC

Re: Path not found

Post by *blablaalb »

Dalai wrote: 2021-07-31, 12:37 UTC Perhaps it works when using single quotes like

Code: Select all

cd 'path_here'
Regards
Dalai
Doesn't work either.
blablaalb
Junior Member
Junior Member
Posts: 14
Joined: 2018-11-25, 15:37 UTC

Re: Path not found

Post by *blablaalb »

So the main question is still open: How to make it to work with Total Commander?
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Path not found

Post by *Dalai »

The thing is that there are several layers involved: TC, Windows Terminal and Windows PowerShell. Partly they use the same syntax to escape characters, but in other parts/places they don't. Well, I don't see a way without a kind of wrapper script that takes care of all (special) characters that need escaping...

One last thing that comes to mind: Did you try to remove the arguments from the TC button altogether? That way, the currently active path is used to launch a program.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
blablaalb
Junior Member
Junior Member
Posts: 14
Joined: 2018-11-25, 15:37 UTC

Re: Path not found

Post by *blablaalb »

Dalai wrote: 2021-07-31, 13:08 UTC The thing is that there are several layers involved: TC, Windows Terminal and Windows PowerShell. Partly they use the same syntax to escape characters, but in other parts/places they don't. Well, I don't see a way without a kind of wrapper script that takes care of all (special) characters that need escaping...

One last thing that comes to mind: Did you try to remove the arguments from the TC button altogether? That way, the currently active path is used to launch a program.

Regards
Dalai
Yes, I tried. Without arguments it starts from my user directory C:\Users\blablaalb>
I'll probably leave it without arguments for now.
Thank you for your input!
NotNull
Senior Member
Senior Member
Posts: 266
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: Path not found

Post by *NotNull »

Never mind; I misread the question ...
holst@wmd.de
Junior Member
Junior Member
Posts: 11
Joined: 2016-09-19, 13:43 UTC

Re: Button: "Path not found" on path with squared bracket [...]

Post by *holst@wmd.de »

Last entry from this thread works for me.

viewtopic.php?p=398285&hilit=windows+terminal#p398285
blablaalb
Junior Member
Junior Member
Posts: 14
Joined: 2018-11-25, 15:37 UTC

Re: Button: "Path not found" on path with squared bracket [...]

Post by *blablaalb »

So, the issue appeared to be caused by the last \ character included in path. If I enclosed path within quotes the \ character at the end of a path escaped the last quote character. Stripping out \ from the end of path solved the issue.

Code: Select all

-d "%P:~0,-1%"
:arrow: Topic can be closed. Thanks everyone!
Post Reply