-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_shortcuts.vbs
33 lines (24 loc) · 1.1 KB
/
create_shortcuts.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
32
33
Option Explicit
Dim baseFolder, linkFile1, linkFile2, targetPath, objShell1, objShell2, desktopPath, progPath, oFSO
Set objShell1 = Wscript.CreateObject("Wscript.Shell")
desktopPath = objShell1.SpecialFolders("Desktop")
Set objShell2 = Wscript.CreateObject("Wscript.Shell")
progPath = objShell2.SpecialFolders("Programs")
With WScript.CreateObject("Scripting.FileSystemObject")
baseFolder = .BuildPath( .GetParentFolderName( WScript.ScriptFullName ), "\")
linkFile1 = .BuildPath( desktopPath, "Rocket Ministry.lnk" )
linkFile2 = .BuildPath( progPath, "Rocket Ministry.lnk" )
targetPath = .BuildPath( baseFolder, "Rocket Ministry.vbs" )
End With
With WScript.CreateObject("WScript.Shell").CreateShortcut( linkFile1 )
.TargetPath = targetPath
.WorkingDirectory = baseFolder
.IconLocation= baseFolder & "icon.ico"
.Save
End With
With WScript.CreateObject("WScript.Shell").CreateShortcut( linkFile2 )
.TargetPath = targetPath
.WorkingDirectory = baseFolder
.IconLocation= baseFolder & "icon.ico"
.Save
End With