-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|545|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> File Access


 
HoboBen
Created : 21 April 2008
Edited : 01 July 2008
System : Windows
Language : Cobra

LNK Resolver

Contains functions to resolve windows shortcut (.lnk) files.

|edit| UPDATE: Finished a unit that can read/write windows shortcut files properly: socoder.net/index.php?showcase=14335 |edit|

A simple unit to resolve windows .lnk shortcut files.

I'm planning to restructure this and expand it so that I can return a few more things about the file - e.g. start-in folder, icon path, etc.



Here's a simple program to demonstrate (I used the command line shortcut in the start menu, bit it also works if you right click something and just create a shortcut from that menu)



It also seems to work on shortcuts to folders

 

Comments


Tuesday, 22 April 2008, 02:32
Jayenkai
Woot!
I tried writing shortcuts in Blitz a few years back.

I gave up soon afterwards!

Good work, HoboBen
Tuesday, 22 April 2008, 04:53
HoboBen
Oh, I'm not writing them (yet!) I'm just searching for the path inside a .lnk file, so that if you have a file browser written, you can follow all of your messy desktop shortcuts to wherever they may lead.

It's a bit hacky, as it's just searching for a path in the format [A-Z]:\[a string] followed by two nulls, but next I want to actually analyze the header so that I can do it a bit more neatly, and get all the attributes in the process...

And hopefully, as the very last step, get it to be able to write one... dunno though, windows lnk files are quite cryptic!