Advertisement
Guest User

Untitled

a guest
Oct 29th, 2018
1,148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Haphazardly cobbled together with love by SariaFace -^,..,^-
  2. closePrevInstance = true 'set to true to close all open instances of VRChat before launching
  3. disableVR = true '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 closing 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.         process.Terminate()
  15.     next
  16. end if
  17.  
  18. 'Prompt to or automatically prepend the launch parameters from the SDK with --no-vr if specified in options
  19. args = WScript.Arguments(0)
  20. if disableVR then
  21.     args = "--no-vr " & args
  22. elseif askNoVR then
  23.     result = MsgBox("Launch in no-VR (desktop) mode?", vbYesNo)
  24.     Select Case result
  25.     Case vbYes
  26.         args = "--no-vr " & args
  27.     end Select
  28. end if
  29.  
  30. Call CreateObject("WScript.Shell").Run ( Chr(34) & launchPath & Chr(34) + args, 1, true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement