Does Anyone know a Way of reading from a Shortcut File (.lnk) ? or Does anyone know the Format of shortcuts (.lnk). I have Tried the windows script host object model COM Component But I can't Get It To Work.
Thanks in Advance,
BlindSniper
Printable View
Does Anyone know a Way of reading from a Shortcut File (.lnk) ? or Does anyone know the Format of shortcuts (.lnk). I have Tried the windows script host object model COM Component But I can't Get It To Work.
Thanks in Advance,
BlindSniper
Can you show us your code?
I followed quite a few examples on the net and you couldn't even paste the code into Visual studio without getting errors and I looked around in the component there was nothing i could make heads or tails of but i'll try And Paste code in a few Minutes
OK i Figured out how to create A shortcut But that Doesn't help a lot (yet). I need to read all the data from an existing shortcut which isn't possible with the windows script host object model(as far as i can see).
The attached project uses code from another developer to read/write shortcuts. I created the project in VS2005 and just upgraded it to VS2008, tested it as is on Windows Vista.
Try it out, it will recurse thru the start menu, quick launch and desktop looking at all shortcuts and logging the information to a textfile which is opened after the recursive ops are done. Empty shortcuts are ignored, ability to change is commented out. About the only issue I can think of is authority to read the files which I didn't have issues with on Windows XP or Vista.
The key to read a shortcut with the code used
Where FileName is the full path and shortcut file name concatenated together.Code:Dim Shortcut As MSjogren.Samples.ShellLink.VB.ShellShortcut = _
New MSjogren.Samples.ShellLink.VB.ShellShortcut(FileName)
Thanks Will Give it a try :)
Ok I got It Working Thank you very much! :) . One More little Off Topic Question : Wouldn't it be easier to just read the bytes from the shortcut and Populate the properties from there ? It Seems a Bit overkill as it is But i'm not complaining It works