IWshShortcut Target Resolution in Windows 7
- by Dan Walker
I've got some code to read shortcuts using the Windows Script Host, but it appears to have a problem in Windows 7. When reading shortcuts, if there is an environment variable in the target path, it resolves to the wrong drive. For example, the shortcut to Notepad resolves to D:\Windows\system32\notepad.exe instead of C:\Windows\system32\notepad.exe.
The problem is not with my computer's settings, because the shortcut works just fine, and when looking at the value for %SystemRoot%, it shows C:\Windows.
Any ideas as to what could be the problem, or alternatively, what a different method of reading shortcuts would be?
Thanks,
Dan