Created
July 20, 2024 08:44
-
-
Save SanjaySRocks/d241187cb1a273f639890a13baa6ebc7 to your computer and use it in GitHub Desktop.
Automatically fix CrowdStrike BSOD in Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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