Guest User

Untitled

a guest
Apr 15th, 2020
1,306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.14 KB | None | 0 0
  1. :: Simple script to rename the file ModernWarfare.exe to ModernWarfare1.exe to prevent chrashes
  2. :: revised version. i have increased the time to change the process priority.
  3. :: Also, the process priority is constantly reset to normal (no idea if this is necessary, for some users the priority seems to have increased again by itself, so here is the solution)
  4. @ECHO off
  5. :: Change your install path here
  6. set place=F:\Games\Call of Duty Modern Warfare
  7. set PROCNAME="ModernWarfare.exe"
  8.  
  9.     :startbattlenet
  10. Echo Start Battle.net...
  11. "%place%\Modern Warfare Launcher.exe"
  12. @ping -n 5 localhost> nul
  13. cls
  14. :checkstart
  15. TaskList|Find "Blizzard Battle.net App" >NUL || If Errorlevel 1 Goto startgame
  16. Goto checkstart
  17.  
  18.  
  19.     :startgame
  20. echo checking game status...
  21. tasklist /FI "IMAGENAME eq %PROCNAME%*" 2>NUL | find /I /N %PROCNAME%>NUL
  22. if "%ERRORLEVEL%"=="0" (
  23.     Goto gameruns
  24. )
  25. cls
  26. Goto startgame
  27.  
  28.  
  29.     :exitgame
  30. echo checking game status...
  31. tasklist /FI "IMAGENAME eq %PROCNAME%*" 2>NUL | find /I /N %PROCNAME%>NUL
  32. if "%ERRORLEVEL%"=="0" (
  33.     cls
  34.     @ping -n 15 localhost> nul
  35.     wmic process where name="ModernWarfare.exe" CALL setpriority "normal" >nul
  36.     Goto exitgame
  37. )
  38. cls
  39. Goto gamequits
  40.  
  41.     :gameruns
  42. @ping -n 5 localhost> nul
  43. ren "%place%\ModernWarfare.exe" ModernWarfare1.exe >nul
  44. if exist "%place%\ModernWarfare1.exe" goto startrenameok
  45. echo Oops, something went wrong. Let's try it again
  46. @pause
  47. goto startgame
  48.  
  49.    :startrenameok
  50. cls
  51. ECHO File renamed successfully!
  52. @ping -n 15 localhost> nul
  53. ECHO Changing priority...
  54. wmic process where name="ModernWarfare.exe" CALL setpriority "normal" >nul
  55. ECHO Priority changed to normal
  56. @ping -n 3 localhost> nul
  57. ECHO Have fun playing
  58. @ping -n 5 localhost> nul
  59. cls
  60. GOTO exitgame
  61.  
  62.    :gamequits
  63. ren "%place%\ModernWarfare1.exe" ModernWarfare.exe >nul
  64. if exist "%place%\ModernWarfare.exe" goto quitrenameok
  65. echo Oops, something went wrong. Let's try it again
  66. goto startgame
  67.  
  68.     :quitrenameok
  69. cls
  70. ECHO File renamed successfully!
  71. ECHO I hope it was fun.
  72. GOTO exitscript
  73.  
  74.     :exitscript
  75. echo.
  76. echo Script will be terminated...
  77. @ping -n 3 localhost> nul
  78. exit
Advertisement
Add Comment
Please, Sign In to add comment