-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathApply DBX update.cmd
More file actions
22 lines (16 loc) · 911 Bytes
/
Apply DBX update.cmd
File metadata and controls
22 lines (16 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@echo off
set DesiredAvailableUpdates=0x2
echo Desired AvailableUpdates: %DesiredAvailableUpdates%
FOR /F "tokens=3*" %%A IN ('REG QUERY HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Secureboot /v AvailableUpdates 2^>nul') DO (
SET CurrentAvailableUpdates=%%A
)
echo Current AvailableUpdates: %CurrentAvailableUpdates%
set /a "TargetAvailableUpdates = %CurrentAvailableUpdates% | %DesiredAvailableUpdates%"
FOR /F "tokens=*" %%A IN ('powershell -Command "\""0x{0:X}\"" -f %TargetAvailableUpdates%"') DO (
SET TargetAvailableUpdates=%%A
)
echo Setting AvailableUpdates to %TargetAvailableUpdates%
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Secureboot /v AvailableUpdates /t REG_DWORD /d %TargetAvailableUpdates% /f
echo Starting \Microsoft\Windows\PI\Secure-Boot-Update
powershell -Command "Start-ScheduledTask -TaskName \""\Microsoft\Windows\PI\Secure-Boot-Update\"""
pause