w10install/image/format-disk.cmd
2024-09-28 16:25:23 +02:00

17 lines
512 B
Batchfile

@echo off
wpeinit && echo INFO: wpeinit OK
wpeutil UpdateBootInfo > NUL && echo INFO: wpeutil UpdateBootInfo OK
for /f "tokens=2* delims= " %%A in ('reg query HKLM\System\CurrentControlSet\Control /v PEFIRMWAREType') do set FIRMWARE=%%B
if %FIRMWARE%==0x1 (
echo FIRMWARE=%FIRMWARE% [BIOS]
echo ==========================
diskpart /s %SystemDrive%\format-BIOS.txt
) else (
echo FIRMWARE=%FIRMWARE% [UEFI]
echo ==========================
diskpart /s %SystemDrive%\format-UEFI.txt
)