-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install.vbs
31 lines (23 loc) · 896 Bytes
/
Install.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Dim oShell
Dim Quotes
Dim sScriptDir
Dim oShortcut
Dim desktopPath
' Double-quotes
Quotes = Chr(34)
Set oShell = CreateObject("WScript.Shell")
' Get script directory without trailing slash
sScriptDir = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")-1)
'If root of drive, strip trailing backslash
If Len(sScriptDir) = 3 Then sScriptDir = Left(sScriptDir, 2)
' Get Desktop folder path
desktopPath = oShell.SpecialFolders("Desktop")
Set oShortcut = oShell.CreateShortcut(desktopPath & "\New-ShortURL.lnk")
oShortcut.Arguments = Quotes & sScriptDir & "\Launch.vbs" & Quotes
oShortcut.Description = "https://github.com/Isaac-Duarte/ShortUrl"
oShortcut.HotKey = "CTRL+ALT+C"
oShortcut.IconLocation = "%SystemRoot%\System32\SHELL32.dll,14"
oShortcut.TargetPath = "%WINDIR%\System32\wscript.exe"
oShortcut.WindowStyle = 4
oShortcut.WorkingDirectory = sScriptDir
oShortcut.Save