Skip to content

Commit

Permalink
Make Windows Defender PE script more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
cschneegans committed Aug 17, 2024
1 parent 355cad9 commit 873fdbe
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions resource/disable-defender-pe.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ SET file=C:\$Windows.~BT\NewOS\Windows\System32\config\SYSTEM
FOR /L %%i IN (0) DO (
CALL :sleep
IF EXIST %file% (
CALL :load
FOR %%s IN (Sense WdBoot WdFilter WdNisDrv WdNisSvc WinDefend) DO reg.exe ADD HKLM\mount\ControlSet001\Services\%%s /v Start /t REG_DWORD /d 4 /f
reg.exe UNLOAD HKLM\mount
EXIT ) )
IF EXIST %file%.LOG1 (
IF EXIST %file%.LOG2 (
CALL :load
FOR %%s IN (Sense WdBoot WdFilter WdNisDrv WdNisSvc WinDefend) DO reg.exe ADD HKLM\mount\ControlSet001\Services\%%s /v Start /t REG_DWORD /d 4 /f
reg.exe UNLOAD HKLM\mount
EXIT ) ) ) )

GOTO :eof

:load
CALL :sleep
reg.exe LOAD HKLM\mount %file%
IF %errorlevel% GTR 0 GOTO load
GOTO :eof

:sleep
ping.exe -n 1 127.0.0.1 > NUL
ping.exe -n 2 127.0.0.1 > NUL
GOTO :eof

0 comments on commit 873fdbe

Please sign in to comment.