Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Haphazardly cobbled together with love by SaSa/SariaFace -^,..,^-
- closePrevInstance = true 'set to true to close all open instances of VRChat before launching
- disableVR = false 'set to true to ALWAYS launch tests in desktop mode (bypasses askNoVR when true)
- askNoVR = true 'set to false to bypass asking for no-vr mode
- 'On some systems, current working directory points to wrong location. This uses script locale
- launchPath = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName))) & "VRChat.exe"
- 'Search for and close all open instances of VRChat.exe. Manually closin would be better, but you are busy (read: lazy), yes?
- if closePrevInstance then
- Set WMISvc = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
- Set processList = WMISvc.ExecQuery( "Select * from Win32_Process Where Name = 'VRChat.exe'")
- for each process in processList
- if InStr(process.CommandLine, "BuildAndRun") then
- process.Terminate()
- end if
- next
- end if
- 'Prompt to or automatically prepend the launch parameters from the SDK with --no-vr if specified in options
- args = WScript.Arguments(0)
- if disableVR then
- args = "--no-vr " & args
- elseif askNoVR then
- result = MsgBox("Launch in no-VR (desktop) mode?" & vbCrLf & "Yes (desktop) No (vr)", vbYesNoCancel)
- Select Case result
- Case vbYes
- args = "--no-vr " & args
- Case vbCancel
- WScript.Quit 0
- end Select
- end if
- Call CreateObject("WScript.Shell").Run ( Chr(34) & launchPath & Chr(34) + args, 1, true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement