0%

CMD 获取 WinRE 状态

查询 bcdedit /enum 启动项的 ‘recoveryenabled’ 字段判断 Windows RE 开启状态

1
2
3
4
5
6
7
8
@echo off
for /f "tokens=1,2 delims= " %%i in ('bcdedit /enum') do (
if /i '%%i'=='recoveryenabled' (
if /i '%%j'=='yes' (echo [%time%][%~n0] WinRE is Enabled& exit /b 0)
)
)
echo [%time%][%~n0] WinRE is Disabled
exit /b 1
觉得文章有用?请我喝杯咖啡~