Skip to content

Instantly share code, notes, and snippets.

@ml4den
Last active April 11, 2020 12:56
Show Gist options
  • Save ml4den/dab3fb521afa606c04cc077eea8a34d6 to your computer and use it in GitHub Desktop.
Save ml4den/dab3fb521afa606c04cc077eea8a34d6 to your computer and use it in GitHub Desktop.
Easy Fix for Call of Duty Warzone Crashing in PowerShell
# Set path to game:
$game = "X:\Games\Warzone\Call of Duty Modern Warfare\ModernWarfare.exe"
Write-Host "Please start the game if not already running." -ForegroundColor Yellow
Write-Host "$(Get-Date)`tChecking for game process..."
Do {
$process = Get-Process -Name "ModernWarfare" -ErrorAction SilentlyContinue
Start-Sleep 5
}
Until ($process)
Write-Host "$(Get-Date)`t$($process.ProcessName) is running."
if ({Test-Path -Path $game}){
Write-Host "$(Get-Date)`tGiving the game 15 seconds to load..."
Start-Sleep 15
Write-Host "$(Get-Date)`Removing file..."
Remove-Item $game -Force
} else { Write-Host "$(Get-Date)`tGame is already good to go." }
@ml4den
Copy link
Author

ml4den commented Apr 11, 2020

How does this work?

You run the script and then start the game from the launcher.

It checks if the game is running, then gives it some time to load and deletes ModernWarfare.exe if it exists. This has been reported on Reddit to prevent in game crashes for users experiencing them.

You will have to enter the path to your game on line 2 and probably run this as admin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment