Advertisement
Wasif_Hasan_

ShortcutMaker.vbs (v2 - Updated)

Sep 18th, 2020
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub Shortcut(Application,Name,Location,Icon,Hotkey)
  2.   Dim objShell,DesktopPath,objShortCut,MyTab
  3.   If IsEmpty(Icon) Then
  4.     Icon = "winver.exe,0"
  5.   End If
  6.   If IsEmpty(Hotkey) Then
  7.      NoHotkey = True
  8.   End If
  9.   Set objShell = CreateObject("WScript.Shell")
  10.   MyTab = Split(Application,"\")
  11.   If Name = "" Then
  12.     Name = MyTab(UBound(MyTab))
  13.   End if
  14.   Set objShortCut = objShell.CreateShortcut(DblQuote(Location & "\" & Name & ".lnk"))
  15.   With objShortCut
  16.     .TargetPath = DblQuote(Application)
  17.     .IconLocation = Icon
  18.     If Not(NoHotkey) Then
  19.        .Hotkey = Hotkey
  20.     End If
  21.     .Save
  22.   End With
  23. End Sub
  24. Sub DblQuote(Str)
  25.   DblQuote = Chr(34) & Str & Chr(34)
  26. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement