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 = ""
        .Description = "Description of shortcut"
        '       Location of Icon
        .IconLocation = "%SystemRoot%\system32\SHELL32.dll,5"
        .RelativePath = "c:\temp"
        .WorkingDirectory = "c:\"
        'Hot Key
        .Hotkey = "Ctrl+Alt+Q"
    End With
Next i
End Sub


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: