Bug with links to virtual stuff
Moderators: Hacker, petermad, Stefan2, white
Bug with links to virtual stuff
Occurs in the latest 7.0 release.
Steps to reproduce:
1. Enable "Internet Explorer" icon on the Desktop (Control Panel -> Display -> Desktop -> Customize Desktop -> Desktop icons group -> Enable the "Internet Explorer" checkbox)
2. Create a link to this icon (by dragging it with the right mouse button and choosing "create shortcut"). Note that in my tests it was impossible to create a shortcut to this item directly on the desktop.
3. Press enter on this shortcut in Total Commander.
What should happen:
- the default action (which is to "Open Home Page") should be executed
What actually happens:
- Total Commander thinks this link points to a folder so it enters this folder "\\Internet Explorer". This "folder" is empty and the parent directory is the Desktop.
I think TC thinks all this virtual items are folders (so the shortcut to them should list their contents), which is obviously not the case with "Internet Explorer"
Steps to reproduce:
1. Enable "Internet Explorer" icon on the Desktop (Control Panel -> Display -> Desktop -> Customize Desktop -> Desktop icons group -> Enable the "Internet Explorer" checkbox)
2. Create a link to this icon (by dragging it with the right mouse button and choosing "create shortcut"). Note that in my tests it was impossible to create a shortcut to this item directly on the desktop.
3. Press enter on this shortcut in Total Commander.
What should happen:
- the default action (which is to "Open Home Page") should be executed
What actually happens:
- Total Commander thinks this link points to a folder so it enters this folder "\\Internet Explorer". This "folder" is empty and the parent directory is the Desktop.
I think TC thinks all this virtual items are folders (so the shortcut to them should list their contents), which is obviously not the case with "Internet Explorer"
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
If you go to the Desktop in Total Commander (via the menu), then you will see that "Internet Explorer" is shown as a folder - because Windows reports it as a folder to TC, not as a file! So how should TC know that this "folder" cannot be listed?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
From button…
2ghisler(Author)
Good morning,
• Here, I've a button in the bar for the command cm_OpenDesktop.
- From that button, I get IE shown as a file (but without any info, though), and double-clicking it starts the IE browser…
- An oddness is that I've set SingleClickStart=6, and it doesn't work there.
- Not a big deal, though.
- In the same list, only “My Documents” is shown as a folder I can open normally,
but no level up with “••” from the drive buttons…
- Just a remark, because IMHO the Desktop is the worst thing to use in handling files, I never do so.
VG
Claude
Clo

• Here, I've a button in the bar for the command cm_OpenDesktop.
- From that button, I get IE shown as a file (but without any info, though), and double-clicking it starts the IE browser…

- An oddness is that I've set SingleClickStart=6, and it doesn't work there.
- Not a big deal, though.
- In the same list, only “My Documents” is shown as a folder I can open normally,
but no level up with “••” from the drive buttons…
- Just a remark, because IMHO the Desktop is the worst thing to use in handling files, I never do so.

Claude
Clo
#31505 Traducteur Français de T•C French translator Aide en Français Tutoriels Français English Tutorials
2ghisler(Author)
Back to the problem. When executing the shell link file with ShellExecuteEx Internet Explorer is started as astrotzky wrote. What are you doing to execute the shell link file?
There is no <DIR> entry right to the Internet Explorer icon here. It's sorted as a file.If you go to the Desktop in Total Commander (via the menu), then you will see that "Internet Explorer" is shown as a folder - because Windows reports it as a folder to TC, not as a file! So how should TC know that this "folder" cannot be listed?
Back to the problem. When executing the shell link file with ShellExecuteEx Internet Explorer is started as astrotzky wrote. What are you doing to execute the shell link file?
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Apparently Microsoft have changed that - it is definitely a folder here in Windows 2000!
This works fine here when I enable the "Internet Explorer" on the desktop or not - it has no influence.
I first ask the OLE object for the target name. If this fails, I just execute it. I tried it on Windows XP here: A double click on "Internet Explorer" on the Desktop does start the Internet Explorer here!What are you doing to execute the shell link file?
This works fine here when I enable the "Internet Explorer" on the desktop or not - it has no influence.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I can confirm this:ghisler(Author) wrote:Apparently Microsoft have changed that - it is definitely a folder here in Windows 2000!
in Win2k it appears like a directory (double-click opens the empty folder in TC),
in XP like a file (double-click starts IE).
A created Link to this (Ctrl+Shift+F5) does not work in any of the two cases here
(the target in the *.LNK file will be "\\Desktop\Internet Explorer" - which windows can't find).
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I see. I went through my code to check what TC does:
1. It loads the link as IShellLink object and resolves the link
2. It tries to get the plain path target -> fails
3. It tries to get the ItemIDList target -> success
4. It gets the IShellFolder for this ItemIDList -> success
5. It calls IShellFolder->EnumObjects -> success
-> TC assumes that it is a folder and shows it as a folder.
Why all of this? TC tries to show link targets inside of its panels if it's a file or a virtual folder. Maybe you have a better idea how to handle this?
Btw, to solve the problem, just make a link to IExplore.exe...
1. It loads the link as IShellLink object and resolves the link
2. It tries to get the plain path target -> fails
3. It tries to get the ItemIDList target -> success
4. It gets the IShellFolder for this ItemIDList -> success
5. It calls IShellFolder->EnumObjects -> success
-> TC assumes that it is a folder and shows it as a folder.
Why all of this? TC tries to show link targets inside of its panels if it's a file or a virtual folder. Maybe you have a better idea how to handle this?
Btw, to solve the problem, just make a link to IExplore.exe...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
to ghisler:
Windows Explorer opens Internet Explorer when double clicking or pressing enter on the link.
This is the expected behaviour and people will get confused otherwise.
I reported this not because it bothers me (indeed I don't even use Internet Explorer, I saw the issue on a friend's computer) but because it might reveal a problem in the way you handle virtual items.
OTOH, I wouldn't be surprised if Windows Explorer is doing something non-standard here.
So it's a bug and should be put in your bug tracking system.
It's up to you to assing it a priority (probably "very low").
As for the workaround my friend already did that
Windows Explorer opens Internet Explorer when double clicking or pressing enter on the link.
This is the expected behaviour and people will get confused otherwise.
I reported this not because it bothers me (indeed I don't even use Internet Explorer, I saw the issue on a friend's computer) but because it might reveal a problem in the way you handle virtual items.
OTOH, I wouldn't be surprised if Windows Explorer is doing something non-standard here.
So it's a bug and should be put in your bug tracking system.
It's up to you to assing it a priority (probably "very low").
As for the workaround my friend already did that

- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Well, to do this, I would first have to get the parent, then get the attributes of the child. What if the parent is slow or inaccessible? I will note it for a later release, but for TC 7.01 it's just too risky.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
2ghisler(Author)
No hurry it's not an urgent issue.
In this sample SHGetFileInfo is used to get the SFGAO_FOLDER attribute. According to the MSDN SHGetFileInfo calls IShellFolder::GetAttributesOf internally. It may be easier as it works with an absolute item id list.
fi.dwAttribute now contains the requested attribute (SFGAO_FOLDER) if the link points to a folder. I have also tried this with other lnk files which actually point to a virtual folder or physical directory and it seems to work fine.
Another hint:
You wrote that you are calling IShellLink::GetPath to get a physical path and if it fails request the item id list. To find out if the link contains a certain information you can also call IShellLinkDataList::GetFlags. I'm using this operation in my Shortcut content plug-in.
No hurry it's not an urgent issue.
In this sample SHGetFileInfo is used to get the SFGAO_FOLDER attribute. According to the MSDN SHGetFileInfo calls IShellFolder::GetAttributesOf internally. It may be easier as it works with an absolute item id list.
Code: Select all
LPITEMIDLIST ppidl;
// m_pLink is a pointer of type IShellLink.
m_pLink->GetIDList (&ppidl);
SHFILEINFO fi;
ZeroMemory (&fi, sizeof (SHFILEINFO));
fi.dwAttributes = SFGAO_FOLDER;
SHGetFileInfo ((LPCTSTR)ppidl, 0, &fi, sizeof (SHFILEINFO), SHGFI_ATTR_SPECIFIED | SHGFI_ATTRIBUTES | SHGFI_PIDL);
Another hint:
You wrote that you are calling IShellLink::GetPath to get a physical path and if it fails request the item id list. To find out if the link contains a certain information you can also call IShellLinkDataList::GetFlags. I'm using this operation in my Shortcut content plug-in.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Confirm bug in 7.01 and fix in 7.02.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 11.03 / Win10 x64
Using TC 11.03 / Win10 x64
Confirmed fixed in TC 7.02 
TC now opens Internet Explorer when clicking a .lnk file pointing to the Internet Explorer icon on the desktop.

TC now opens Internet Explorer when clicking a .lnk file pointing to the Internet Explorer icon on the desktop.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar