.NET read binary contents of .lnk file

Posted by Flores on Stack Overflow See other posts from Stack Overflow or by Flores
Published on 2010-04-02T09:17:02Z Indexed on 2010/04/02 9:23 UTC
Read the original article Hit count: 244

Filed under:
|
|

I want to read the binary contents of a .lnk file. As long as the target of the shortcut (lnk file) exists this works fine with IO.File.ReadAllBytes(string file).

BUT

If the target of the shortcut does not exist (believe me I want this) the method only returns zero's. I guess this is because the OS follows the link and if it does not exist it returns zero's

Is there some way to bypass the fact that the framework follows the target of the .lnk before displaying the contents of the .lnk file?

© Stack Overflow or respective owner

Related posts about c#

Related posts about shortcut