Create a shortcut

From HashVB
Revision as of 22:37, 5 December 2005 by Dee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Public Sub CreateShortcut(Destination As String, Name As String, _
  Target As String, Parameters As String)
Dim Shell As Object 'WshShell
Dim NewShortcut As Object 'WshShortcut
        
  Set Shell = CreateObject("wscript.shell.1")
  Set NewShortcut = Shell.CreateShortcut(Destination & Name & ".lnk")
  NewShortcut.TargetPath = Target
  NewShortcut.Arguments = Parameters
  NewShortcut.Save
End Sub