-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathlaunch.vbs
30 lines (25 loc) · 1.02 KB
/
launch.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
Set objArgs = WScript.Arguments
Set objFSO = CreateObject("Scripting.FileSystemObject")
scriptDir = objFSO.GetParentFolderName(WScript.ScriptFullName)
psScriptPath = scriptDir & "\launch.ps1"
Dim psArgs, windowStyle, windowPolicy, waitPolicy
psArgs = ""
windowStyle = "Normal"
windowPolicy = 1
waitPolicy = True
For i = 0 To objArgs.Count - 1
If LCase(objArgs(i)) = "--quiet" Then
windowStyle = "Hidden"
windowPolicy = 0
Else
psArgs = psArgs & " """ & objArgs(i) & """"
End If
Next
Set objShell = CreateObject("WScript.Shell")
objShell.Run "powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle " & windowStyle & " -File """ & psScriptPath & """" & " --ensure-install", windowPolicy, waitPolicy
Set objShell = Nothing
Set objShell = CreateObject("WScript.Shell")
objShell.Run "powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle " & windowStyle & " -File """ & psScriptPath & """" & psArgs, windowPolicy, waitPolicy
Set objShell = Nothing
Set objFSO = Nothing
Set objShell = Nothing