Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Simple script to rename the file ModernWarfare.exe to ModernWarfare1.exe to prevent chrashes
- :: revised version. i have increased the time to change the process priority.
- :: 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)
- @ECHO off
- :: Change your install path here
- set place=F:\Games\Call of Duty Modern Warfare
- set PROCNAME="ModernWarfare.exe"
- :startbattlenet
- Echo Start Battle.net...
- "%place%\Modern Warfare Launcher.exe"
- @ping -n 5 localhost> nul
- cls
- :checkstart
- TaskList|Find "Blizzard Battle.net App" >NUL || If Errorlevel 1 Goto startgame
- Goto checkstart
- :startgame
- echo checking game status...
- tasklist /FI "IMAGENAME eq %PROCNAME%*" 2>NUL | find /I /N %PROCNAME%>NUL
- if "%ERRORLEVEL%"=="0" (
- Goto gameruns
- )
- cls
- Goto startgame
- :exitgame
- echo checking game status...
- tasklist /FI "IMAGENAME eq %PROCNAME%*" 2>NUL | find /I /N %PROCNAME%>NUL
- if "%ERRORLEVEL%"=="0" (
- cls
- @ping -n 15 localhost> nul
- wmic process where name="ModernWarfare.exe" CALL setpriority "normal" >nul
- Goto exitgame
- )
- cls
- Goto gamequits
- :gameruns
- @ping -n 5 localhost> nul
- ren "%place%\ModernWarfare.exe" ModernWarfare1.exe >nul
- if exist "%place%\ModernWarfare1.exe" goto startrenameok
- echo Oops, something went wrong. Let's try it again
- @pause
- goto startgame
- :startrenameok
- cls
- ECHO File renamed successfully!
- @ping -n 15 localhost> nul
- ECHO Changing priority...
- wmic process where name="ModernWarfare.exe" CALL setpriority "normal" >nul
- ECHO Priority changed to normal
- @ping -n 3 localhost> nul
- ECHO Have fun playing
- @ping -n 5 localhost> nul
- cls
- GOTO exitgame
- :gamequits
- ren "%place%\ModernWarfare1.exe" ModernWarfare.exe >nul
- if exist "%place%\ModernWarfare.exe" goto quitrenameok
- echo Oops, something went wrong. Let's try it again
- goto startgame
- :quitrenameok
- cls
- ECHO File renamed successfully!
- ECHO I hope it was fun.
- GOTO exitscript
- :exitscript
- echo.
- echo Script will be terminated...
- @ping -n 3 localhost> nul
- exit
Advertisement
Add Comment
Please, Sign In to add comment