Opening Windows .lnk Files

Does anyone know how to do this? If I open a file on Windows e.g. "asn_application.h.lnk" then I get the link data rather than the data in the linked file. Thanks, Dominic.

Hi Drop into the command line, rename the file from foo.lnk to foo.txt, using "ren foo.lnk foo.txt", then open "foo.txt". It's a chunk of binary goop, so will likely not be much use. There is a COM class for editing shortcut files (IShellLink), which I've used before from C code. See http://darcs.haskell.org/hugs98/src/winhugs/installer/ShellCode.cpp, in particular the CreateShortcut function. Thanks Neil

Neil Mitchell wrote:
Hi
Drop into the command line, rename the file from foo.lnk to foo.txt, using "ren foo.lnk foo.txt", then open "foo.txt". It's a chunk of binary goop, so will likely not be much use.
There is a COM class for editing shortcut files (IShellLink), which I've used before from C code. See http://darcs.haskell.org/hugs98/src/winhugs/installer/ShellCode.cpp, in particular the CreateShortcut function.
Thanks
Neil
Neil, Thanks but following a discussion on #haskell, it's all beginning to sound a bit hard. Somehow I thought it would be easy. I know where the real files are so I'll just set a directory as a parameter, strip off the .lnk from the name and use that + the directory to manipulate them. Dominic.
participants (2)
-
Dominic Steinitz
-
Neil Mitchell