TC tries to resolve folder names as system variables

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
rsk82
Junior Member
Junior Member
Posts: 8
Joined: 2011-09-08, 21:15 UTC

TC tries to resolve folder names as system variables

Post by *rsk82 »

For example let's create a folder

D:\%appdata% - yes with the same name as one of the system variables

go into it and press ALT+F7 for search, press Enter and you get popup: "Search path not found".

Some apps are using folders with that names, like visualizing or portable-making thinstall or thinapp, i've seen it also in other software occasionally.
User avatar
white
Power Member
Power Member
Posts: 4620
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC tries to resolve folder names as system variables

Post by *white »

rsk82 wrote:For example let's create a folder

D:\%appdata% - yes with the same name as one of the system variables

go into it and press ALT+F7 for search, press Enter and you get popup: "Search path not found".
The variable %appdata% is substituted by it's value, so Total Commander will try to search in something like "D:\c:\Documents..." Obviously this folder cannot be found.

Solution in this case: clear the Search in field

Ever since variable substitution is supported it makes sense if the "Search path not found" error message would also mention the path that was not found.

The auto complete function also fails on these kinds of folders.

Perhaps it would be wise if the % character could be "escaped". For example by using doubling the % character. Additionally it may be wise to include an option in the search dialog to enable/disable variable substitution.
rsk82
Junior Member
Junior Member
Posts: 8
Joined: 2011-09-08, 21:15 UTC

Post by *rsk82 »

yea, but having drive letter before system variable is suspicious by it's way, simple check for drive letter before trying to resolve anything would be great, if there are two drive letters in a path this doesn't make sense... it could be done in more 'smart' way than to let user being aware whats happening

It could be a case that the percented name is hidden somewhere in the long path and you got a bummer

I found some other programs fall for that like Notepad2 and its clones, but others like sublime text or wscite do not. I'd say 50/50 windows apps that open file have this issue.
herman5
Junior Member
Junior Member
Posts: 43
Joined: 2012-08-20, 16:39 UTC

Re: TC tries to resolve folder names as system variables

Post by *herman5 »

rsk82 wrote:For example let's create a folder

D:\%appdata% - yes with the same name as one of the system variables

go into it and press ALT+F7 for search, press Enter and you get popup: "Search path not found".

Some apps are using folders with that names, like visualizing or portable-making thinstall or thinapp, i've seen it also in other software occasionally.
Sorry but everyone who uses a % in a foldername should not be allowed any computeraccess :twisted:
rsk82
Junior Member
Junior Member
Posts: 8
Joined: 2011-09-08, 21:15 UTC

Re: TC tries to resolve folder names as system variables

Post by *rsk82 »

herman5 wrote:Sorry but everyone who uses a % in a foldername should not be allowed any computeraccess :twisted:
tell it for example them: http://www.vmware.com/support/product-support/thinapp.html
User avatar
white
Power Member
Power Member
Posts: 4620
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

The percent sign (%) is a perfectly allowed character for folder and file names. See for example here. Software should be able to handle it.

I think if people would search their hard disk for files or folders with the percent sign in the name, lots of people will find at least a few results. Personally I found several file names containing the percent sign. Among which were Foxit Reader temporary files.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The problem is with user-entered path names like in the search function - TC cannot "know" whether you mean the variable or the path.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4620
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:The problem is with user-entered path names like in the search function - TC cannot "know" whether you mean the variable or the path.
In the example given by the topic starter the path name is not entered by the user, but by Total Commander.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, but it's editable. Sorry but variables really take precedence in such a case.
Author of Total Commander
https://www.ghisler.com
rsk82
Junior Member
Junior Member
Posts: 8
Joined: 2011-09-08, 21:15 UTC

Post by *rsk82 »

ghisler: won't fix ?
herman5
Junior Member
Junior Member
Posts: 43
Joined: 2012-08-20, 16:39 UTC

Post by *herman5 »

rsk82 wrote:ghisler: won't fix ?
there is nothing broken so nothing to fix...
rsk82
Junior Member
Junior Member
Posts: 8
Joined: 2011-09-08, 21:15 UTC

Post by *rsk82 »

and is there a way to escape percents in path name in TC like backslash or %% ?

herman5: broken is that TC can't distinguish between folder name and system variable while system on what it runs goes perfectly fine with it

solution would be: make an escape system for % sing like %% as it is in *.cmd files and if user hits alt+f7 and initial value in the "search-in" folder field is inserted by the system make all %'s escaped
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1013
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

The problem becomes more obvious if you try to put that folder on the buttonbar or something similar.

Btw on the command line it's ^% in batch it's %%
User avatar
white
Power Member
Power Member
Posts: 4620
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Windows "Run" function also has problems with it (tested using Windows XP).

* suppose there is a folder d:\%appdata%\ containing some files.
* click the Start button
* click Run
* type d:\
* the auto-complete function of Windows shows d:\%appdata% and other entries
* select d:\%appdata% and type \
* the auto-complete function does not find the files in d:\%appdata% (because the variable is substituted)
* click the OK button to open d:\%appdata%\ in explorer
* Windows says d:\C:\ is not accessible.
* add quotes around d:\%appdata%\ and click OK again
* Windows says d:\c:\Documents and Settings\<user>\Application Data\ is not accessible.
Post Reply