Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Function IsProcessRunning(strComputer, strProcess)
  2. Dim Process, strObject
  3. IsProcessRunning = False
  4. strObject = "winmgmts://" & strComputer
  5. For Each Process in GetObject(strObject).InstancesOf("win32_process")
  6. If UCase(Process.name) = UCase(strProcess) Then
  7. IsProcessRunning = True
  8. Exit Function
  9. End If
  10. Next
  11. End Function
  12.  
  13. Set objShell = Wscript.CreateObject("Wscript.Shell")
  14. If NOT IsProcessRunning(".", "vcxsrv.exe") Then
  15. objShell.Popup "We will launch vcxsrv.exe first!", 1, "VcXSrv is not running", 64
  16. objShell.Exec("C:\Program Files\VcXsrv\vcxsrv.exe :0 -ac -terminate -lesspointer -multiwindow -clipboard -wgl")
  17. End If
  18. args = "-c" & " -l " & """DISPLAY=:0 terminator"""
  19. WScript.CreateObject("Shell.Application").ShellExecute "bash", args, "", "open", 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement