IWshShortcut Target Resolution in Windows 7

Posted by Dan Walker on Stack Overflow See other posts from Stack Overflow or by Dan Walker
Published on 2009-01-28T23:32:26Z Indexed on 2010/03/14 3:15 UTC
Read the original article Hit count: 475

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

© Stack Overflow or respective owner

Related posts about c#

Related posts about windows-7