Click to See Complete Forum and Search --> : Creating/Editing Shortcut files (.lnk, .url)
Steve North
Feb 8th, 2001, 04:13 PM
Does anyone know if there are any API functions that enable me to do the following:-
1. Create, edit and query the properties of a windows shortcut file ('.lnk' file as appears on desktop)
2. Create, edit and query the properties of an internet shortcut file ('.url' file as appears in "c:\windows\favourites...")
I already have a third party DLL that allows me to do point number 1 above but would like to know how the underlying code works. I have no current way of acheiving point number 2.
Thanks.
Lord Orwell
Feb 10th, 2001, 02:50 AM
Have you thought about simple file i/o? Load the shortcut into memory? They have a standard layout.
KrishnaSantosh
Feb 10th, 2001, 04:49 AM
You Can get The Help Of Windows Scripting Thru VB.
You can Also Create Shortcuts Using APIs. For Details EMail Me.
KrishnaSantosh
Feb 10th, 2001, 04:53 AM
You Can Create A Shortcut file and place it in the desktop using Windows Scripting and VbScript In Visual Basic. For Details EMail Me.
KrishnaSantosh
Feb 10th, 2001, 04:55 AM
You Can Use Windows Scripting And VBScript Inside Visual basic Code To Create A Shortcut And Place It On Desktop. For Source Code EMail Me.
Steve North
Feb 10th, 2001, 05:45 AM
Thanks for the replies.
I've looked at the WshShell.CreateShortcut method which seems to work OK for creating new shortcuts, but how can I find the properties of an existing shortcut or edit an existing shortcut.
The Wscript object model does not expose the shortcut object directly, only through the CreateShortcut method.
If there was a GetShortcut method, this would solve my problem. But without that, I thought there might be an API function that I could use.
KrishnaSantosh
Feb 11th, 2001, 01:42 AM
My System Was Suffering From IE Syndrome. So I Didn't Actually Know That I've Posted 3 Replies.
AllRight, That Doesn't Matter Much.
U Can Also Use The APIs For Creating Shortcuts. Here Is A function For Adding Shortcut To Start Menu.
declare function fCreateShellLink lib "STKIT432.dll" (byval lpstrFolderName as string,Byval lpstrLinkName as string,byval lpstrLinkPath as string,byval lpstrLinkargs as string)
I Also Think There May Be A Mechanism For Reading Shortcuts In that API.
gwdash
Feb 11th, 2001, 08:33 PM
Internet shortcuts are basicly INI Files, so you can use the standard INI Api Functions (ReadPrivateProfileString and WritePrivateProfileStirng(i think)) to read and write to them. open one up in notepad to see what i mean.
Good Luck!
eladkarako
Oct 11th, 2009, 06:29 PM
I've found this code
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=42621&lngWId=1
which works fine for me.
http://www.planetsourcecode.com/upload_PSC/screenshots/PIC20031211622204268.jpg
EladKarako
Lord Orwell
Oct 13th, 2009, 03:10 AM
wow this brings back memories. This question is 8 years old.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.