|
-
Jan 23rd, 2011, 04:32 PM
#1
Thread Starter
Fanatic Member
Reading From a Shortcut
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
-
Jan 23rd, 2011, 04:40 PM
#2
Re: Reading From a Shortcut
Can you show us your code?
-
Jan 23rd, 2011, 04:50 PM
#3
Thread Starter
Fanatic Member
Re: Reading From a Shortcut
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
-
Jan 23rd, 2011, 04:57 PM
#4
Thread Starter
Fanatic Member
Re: Reading From a Shortcut
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).
-
Jan 23rd, 2011, 04:59 PM
#5
Re: Reading From a Shortcut
 Originally Posted by BlindSniper
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).
Hang in there I am uploading one for you.
-
Jan 23rd, 2011, 05:06 PM
#6
Re: Reading From a Shortcut
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
Code:
Dim Shortcut As MSjogren.Samples.ShellLink.VB.ShellShortcut = _
New MSjogren.Samples.ShellLink.VB.ShellShortcut(FileName)
Where FileName is the full path and shortcut file name concatenated together.
-
Jan 23rd, 2011, 05:08 PM
#7
Thread Starter
Fanatic Member
Re: Reading From a Shortcut
Thanks Will Give it a try
-
Jan 23rd, 2011, 05:24 PM
#8
Re: Reading From a Shortcut
 Originally Posted by BlindSniper
Thanks Will Give it a try 
Make sure to explore the code modules as there is more there than I demo'd possible.
-
Jan 23rd, 2011, 05:32 PM
#9
Thread Starter
Fanatic Member
Re: Reading From a Shortcut
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
-
Jan 23rd, 2011, 07:12 PM
#10
Re: Reading From a Shortcut
 Originally Posted by BlindSniper
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
Well let's put it this way, the code offers a lot which is no different than internal libraries. Good to hear the code worked for you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|