Create ShortCut Link at the desired location

Create ShortCut at the desired location.

Option Explicit
Sub MakeShortcut()
'//Need to refer to Windows Script Host Object Module
    Dim WSH As New IWshRuntimeLibrary.IWshShell_Class
    Dim WSHShortcut As IWshRuntimeLibrary.IWshShortcut_Class
    Dim strPath As String
    strPath = "\\aphydbanhllbsd\share\selva\Shortcut.lnk"
    Set WSHShortcut = WSH.CreateShortcut(strPath)
    With WSHShortcut
        .TargetPath = "http://socko.wordpress.com"
        .Description = "Description of shortcut"
        '       Location of Icon
        .IconLocation = "%SystemRoot%\system32\SHELL32.dll,5"
        .RelativePath = "c:\temp"
        .WorkingDirectory = "c:\"
        'Hot Key
        .Hotkey = "Ctrl+Alt+Q"
        .Save
    End With
Next i
End Sub

Leave a Comment

You must be logged in to post a comment.