Results 1 to 2 of 2

Thread: How to get & set property of link file (*.lnk) using VB

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    83

    How to get & set property of link file (*.lnk) using VB

    Hi All,

    How to get target,description and other details from a link (*.lnk) file. i also need to change those property using VB. can anybody help me by posting the VB code.

    pradip

  2. #2
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330
    Hi,
    The MicroSoft Scripting Runtime library has several shortcut (.lnk) functions.
    Here's a piece of code I use to update a link to an Excel spreadsheet that's generated every morning for several people.

    VB Code:
    1. Dim Wsh As IWshRuntimeLibrary.IWshShell_Class
    2.  
    3. Set Wsh = CreateObject("WScript.Shell")
    4. Set sc = Wsh.CreateShortcut(CurDir & "\Desktop\Field Reports " & DateStamp & ".lnk")
    5. sc.TargetPath = CurDir & "\Personal\Field Reports " & UID & " " & DateStamp & ".xls"
    6. sc.Save
    7. Set sc = Nothing

    Al.
    A computer is a tool, not a toy.

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