Is there a way to retrieve the native pathname of the target of a shortcut? In my case below, Eclipse is actually a shortcut to a path under C:\Program Files, not under C:\Program Files (x86); but I can’t find a usage of “shortcuts” that gives me the native path.
q: pathnames of shortcuts of files "C:\ProgramData\Start Menu\Programs\Eclipse\Eclipse-3.6.2-win32-x86_64.lnk"
A: C:\Program Files (x86)\Eclipse-3.6.2\eclipse\eclipse.exe
T: 0.795 ms
(concatenations of characters whose (it != "%00") of it) of lines of files "C:\ProgramData\Start Menu\Programs\Eclipse\Eclipse-3.6.2-win32-x86_64.lnk"
The answer is in there, I can see it.
Also, This seems like a bug. The shortcut inspector should return the contents of the LNK file, not it’s SysWOW interpretation of it. Maybe it is using some sort of WinAPI?
I’m dealing with an older OS image we have, where Eclipse was “installed” by unzipping it into one or both of Program Files and Program Files (x86).
I want to have a task that identifies cases where Eclipse was extracted, but no shortcuts to it were created on the Start Menu; when I find such cases I want to create new shortcuts.
I’ve just about resigned myself to checking for an expected pattern in the names of the shortcut files, but I would have preferred to look at the shortcut targets.
(preceding texts of firsts "%00%00" of following texts of firsts "OSDisk%00" of it) of lines whose(it contains "OSDisk%00" AND it contains "%00%00") of files "C:\ProgramData\Start Menu\Programs\Eclipse\Eclipse-3.6.2-win32-x86_64.lnk"
You could dynamically find Eclipse, then dynamically check for the existence of shortcuts. You could assume that if Eclipse exists and a shortcut for Eclipse exists, then you are probably good to go.
exists folders whose(name of it as lowercase starts with "eclipse") of folders whose(name of it as lowercase starts with "program files") of folders "C:"
Relevance 2:
not exists files whose(name of it as lowercase starts with "eclipse" AND name of it as lowercase ends with ".lnk") of folders "C:\ProgramData\Start Menu\Programs\Eclipse"
Yeah, the problem I encounter is where there are both x32 and x64 installations of Eclipse, but only 0 or 1 shortcuts.
I think I’m going to have to go with shortcut names; or just recreated shortcuts for all Eclipse installations regardless of prior shortcut states and tattoo the system.