Advertisement
Guest User

Untitled

a guest
Jul 11th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. @ECHO OFF
  2.  
  3. SET GameArrary=Bungee, HUB, PvE, PvP, Minigames, Towny, SecQ
  4. FOR %%A IN (%GameArrary%) DO (
  5. CALL :Routine "%~1"
  6. )
  7. EXIT /B
  8.  
  9. :Routine
  10. SET AppName=%~1
  11. SET StopApp=stop
  12. IF [%AppName%]==[Bungee] SET StopApp=end
  13. SET StopPauseSec=5
  14. SET StartPauseSec=10
  15.  
  16. SET TempVBSFile=%temp%\~tmpSendKeysTemp.vbs
  17. IF EXIST "%TempVBSFile%" DEL /F /Q "%TempVBSFile%"
  18.  
  19. ECHO Set WshShell = WScript.CreateObject("WScript.Shell") >>"%TempVBSFile%"
  20. ECHO Wscript.Sleep 900 >>"%TempVBSFile%"
  21. ECHO WshShell.AppActivate "%AppName%" >>"%TempVBSFile%"
  22. ECHO Wscript.Sleep 900 >>"%TempVBSFile%"
  23. ECHO WshShell.SendKeys "%StopApp%" >>"%TempVBSFile%"
  24. ECHO Wscript.Sleep 500 >>"%TempVBSFile%"
  25. ECHO WshShell.SendKeys "{ENTER}" >>"%TempVBSFile%"
  26. ECHO Wscript.Sleep %StopPauseSec%000 >>"%TempVBSFile%"
  27. ECHO WshShell.SendKeys "%%{F4}" >>"%TempVBSFile%"
  28. CSCRIPT //nologo "%TempVBSFile%"
  29.  
  30. timeout /t %StartPauseSec%
  31. start "" "cmd /k call BungeeStartup.bat"
  32. GOTO :EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement