File path parsing error with an external file manager

Found a bug in "Everything"? report it here
Post Reply
zarky
Posts: 2
Joined: Wed Feb 17, 2010 3:28 pm

File path parsing error with an external file manager

Post by zarky »

I was trying to follow FAQ 5.2 "How can I set "Everything" to use an external file Manager?" so I added the lines:

open_folder_path_command=$exec("%ProgramFiles%\totalcmd\totalcmd.exe" "/O $parent(%1)")
open_folder_command=$exec("%ProgramFiles%\totalcmd\totalcmd.exe" "/O %1")

to the .ini file. When I invoked the command I got:
Windows cannot fine 'c:\Program Files (x86'. Make sure you typed the name correctly, and then try again."

The problem is that I am running Windows 7 64-bit and my file manager is in the "c:\program files (x86)\"

The Errorlog.txt shows
16:32:34: Everything 1.2.1.371: d:\dev\everything\src\mu.h(1064): mu::ShellExecuteExUTF8(): ShellExecuteExW(): GetLastError(): 2: failed to execute c:\program files (x86

10/02/16
therube
Posts: 5058
Joined: Thu Sep 03, 2009 6:48 pm

Re: File path parsing error with an external file manager

Post by therube »

Ah, that's neat.
It must be treating the closing parenthesis of (x86 ) as the closing of the parameters to the $exec call.

Suppose you'll run into the same situation even if you typed the path in literally?

Can the paren be escaped or encoded?

Would guess that until it's fixed you would have to call (have installed) Total Commander elsewhere.


(Just guessing here. Wait for Void to confirm.)


But then, nested parens are shown here:
open_folder_path_command=$exec("ExternalFileManager.exe" "$parent(%1)")
void
Developer
Posts: 17157
Joined: Fri Oct 16, 2009 11:31 pm

Re: File path parsing error with an external file manager

Post by void »

Please make sure you keep the double quotes around your external file manager.
zarky
Posts: 2
Joined: Wed Feb 17, 2010 3:28 pm

Re: File path parsing error with an external file manager

Post by zarky »

I worked out a workaround for this problem:

1) I created a junction called c:\pgmfiles pointing to "C:\Program Files (x86)\"
2) I added these lines to the ini file

open_folder_path_command=$exec("c:\pgmfiles\totalcmd\totalcmd.exe" /O /T /P=L "$parent(%1)")
open_folder_command=$exec("c:\pgmfiles\totalcmd\totalcmd.exe" /O /T /P=L "%1")

The /O /T /P=L are parameters for Total Commander.

This setup worked but I'm pretty sure there's a bug somewhere in Everything

I suppose another approach would be to put "C:\Program Files (x86)\totalcmd" in the path specified in the environment variables. Then I wouldn't have to specify the path.

Zarky
void
Developer
Posts: 17157
Joined: Fri Oct 16, 2009 11:31 pm

Re: File path parsing error with an external file manager

Post by void »

The ) is indeed terminating the exec term prematurely.

Added to my "Things to fix" list...
Boofo
Posts: 60
Joined: Tue May 26, 2009 7:37 am

Re: File path parsing error with an external file manager

Post by Boofo »

Change the "$parent(%1)" to "%1". The parent parameter is not necessary or needed in TC. There was a discussion on that a while back in the TC forums.
void
Developer
Posts: 17157
Joined: Fri Oct 16, 2009 11:31 pm

Re: File path parsing error with an external file manager

Post by void »

Please use $$, $%, $( and $) to escape $, %, ( and ).
Chender
Posts: 5
Joined: Wed Dec 29, 2010 10:03 pm

Re: File path parsing error with an external file manager

Post by Chender »

Hi!
How can I open directly a folder or a file in the total commander? When I used XP there wasn't any problem. Everything-1.2.1.452a open the total commander (c:\Program Files\Total CMA Pack\Total CMA Pack.exe) but now I use Windows 7 and this is always overwrite the everything.ini file, and always open explorer.
Is there any way to use for opening file and folder with total commander?
Post Reply