No, I don't mean temporary folder but folder with name %TEMP%. Maybe here it is a Windows bug since Windows doesn't show such icons also.
I just want to know if we can do something with it or not.
Wrong EXE icon if file is in "%temp%" folder
Moderators: Hacker, petermad, Stefan2, white
Hi, MVV.
This works with the variables %PROGRAMFILES%, %USERPROFILE% and %APPDATA% e.g. as well if you use them as folder names. Explorer and T.C. will display the plain executable file icon only and not extract the icon from the executable file.
This behaviour can be reproduced by using T.C. 7.50a or T.C. 7.04a as well. (and Explorer of course)
Kind regards,
Karl
This works with the variables %PROGRAMFILES%, %USERPROFILE% and %APPDATA% e.g. as well if you use them as folder names. Explorer and T.C. will display the plain executable file icon only and not extract the icon from the executable file.
This behaviour can be reproduced by using T.C. 7.50a or T.C. 7.04a as well. (and Explorer of course)
Kind regards,
Karl
Hi, MVV.
Let me speculate wildly, hm, maybe not so wildly after all: API functions cannot handle environment variables. OK, you will know better than I do. But programmers can.
Isn't it imaginable that the Microsoft developers and some well-know Swiss developer are using the same approach? They see an environment variable and call the appropriate function in order to expand it. But too bad in our cases, beause some
dumbo
has created foldernames looking like environment variables which need expanding.
As a result they are trying to extract a programme icon from a location which does not exist. The fallback method is to display the standard executable file icon instead.
I am curious to learn how far away my speculation really is from the truth ...
Kind regards,
Karl
Let me speculate wildly, hm, maybe not so wildly after all: API functions cannot handle environment variables. OK, you will know better than I do. But programmers can.
Isn't it imaginable that the Microsoft developers and some well-know Swiss developer are using the same approach? They see an environment variable and call the appropriate function in order to expand it. But too bad in our cases, beause some


As a result they are trying to extract a programme icon from a location which does not exist. The fallback method is to display the standard executable file icon instead.
I am curious to learn how far away my speculation really is from the truth ...
Kind regards,
Karl
It is truthkarlchen wrote:I am curious to learn how far away my speculation really is from the truth ...

1. Create dir like C:\%temp% and put text file inside it e.g. Keyboard.txt.
2. Run Notepad or any other program and PASTE C:\%temp%\Keyboard.txt in the file name field then press open
3. "The file name is not valid." is popup.
I think this is because when you paste or type the file name, the dialog calls ExpandEnvironmentStrings to get the file, and as a result ExpandEnvironmentStrings return invalid path, something like C:\C:\Windows\Temp\Keyboard.txt
It seems that SHGetFileInfo calls ExpandEnvironmentStrings too.
I know that in most cases software calls expanding envvars functions. But AFAIK to extract icon from file we need to call function like ExtractIconEx that doesn't expand envvars.
BTW, as I see, SHGetFileInfo function tries to expand envvars in passed name.

BTW, as I see, SHGetFileInfo function tries to expand envvars in passed name.

I noticed that too using debugger.ts4242 wrote:It seems that SHGetFileInfo calls ExpandEnvironmentStrings too.

- ghisler(Author)
- Site Admin
- Posts: 50505
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Sorry, this isn't supported. I don't have any plans to change it because it will break handling of environment variables in many other places, e.g. when the user gives the location if an icon in the button bar with an env. var in the name, or when an association contains env. vars.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com