Advertisement
SariaFace

VRChat testbuild launcher

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