-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiscWright.vbs
More file actions
25 lines (19 loc) · 824 Bytes
/
Copy pathDiscWright.vbs
File metadata and controls
25 lines (19 loc) · 824 Bytes
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
' DiscWright - silent launcher.
'
' Starts the WinForms script with its console window hidden, so no black box
' flashes before the app appears. wscript.exe and powershell.exe are both
' Microsoft-signed, so this whole chain runs under Smart App Control.
Option Explicit
Dim sh, fso, base, ps, cmd
Set sh = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
base = fso.GetParentFolderName(WScript.ScriptFullName)
ps = fso.BuildPath(base, "DiscWright.ps1")
If Not fso.FileExists(ps) Then
MsgBox "Cannot find the app script:" & vbCrLf & vbCrLf & ps, 16, "DiscWright"
WScript.Quit 1
End If
cmd = "powershell.exe -NoProfile -ExecutionPolicy Bypass -STA -File """ & ps & """"
sh.CurrentDirectory = base
' 0 = hidden window, False = do not wait for it to exit
sh.Run cmd, 0, False