Skip to content

Instantly share code, notes, and snippets.

@SanjaySRocks
Created July 20, 2024 08:44
Show Gist options
  • Select an option

  • Save SanjaySRocks/d241187cb1a273f639890a13baa6ebc7 to your computer and use it in GitHub Desktop.

Select an option

Save SanjaySRocks/d241187cb1a273f639890a13baa6ebc7 to your computer and use it in GitHub Desktop.
Automatically fix CrowdStrike BSOD in Windows
# Define the full paths to the target files from WinPE prespective
$paths = @(
"C:\Windows\System32\drivers\CrowdStrike\C-00000291*.sys",
"D:\Windows\System32\drivers\CrowdStrike\C-00000291*.sys"
)
# Attempt to delete the files if they exist
foreach ($path in $paths) {
try {
if (Test-Path $path) {
Remove-Item -Path $path -Force
Write-Output "Deleted: $path"
} else {
Write-Output "File not found: $path"
}
} catch {
Write-Output "An error occurred while trying to delete $path. Error: $_"
}
}
# Schedule a restart after 3 minutes
Write-Output "Restarting the computer in 3 minutes..."
shutdown.exe /r /t 180
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment