Results 1 to 10 of 10

Thread: Creating/Editing Shortcut files (.lnk, .url)

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    England
    Posts
    13

    Angry

    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.

  2. #2
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    Have you thought about simple file i/o? Load the shortcut into memory? They have a standard layout.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  3. #3
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    You Can get The Help Of Windows Scripting Thru VB.
    You can Also Create Shortcuts Using APIs. For Details EMail Me.

  4. #4
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    You Can Create A Shortcut file and place it in the desktop using Windows Scripting and VbScript In Visual Basic. For Details EMail Me.

  5. #5
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    England
    Posts
    13

    Arrow

    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.

  7. #7
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    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.

  8. #8
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    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!
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  9. #9
    New Member
    Join Date
    Sep 2009
    Posts
    4

    Re: Creating/Editing Shortcut files (.lnk, .url)

    I've found this code
    http://www.planetsourcecode.com/vb/s...42621&lngWId=1
    which works fine for me.


    EladKarako

  10. #10
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Creating/Editing Shortcut files (.lnk, .url)

    wow this brings back memories. This question is 8 years old.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width