To make things a bit more user friendly, I have created a short cmd to prepare a drive for a windows installation. This comes with (several) caveats:
1) It's been working for me, but still needs more testing. Do *not* have anything you want to keep the data for plugged in when trying the script, just in case
2) It erases the whole drive selected, *including* any extra partitions (like recovery or data partitions). If you want to prepare a drive with partitions you want to keep, just format the partitions the old fashioned way
3) This is a script designed to erase a drive. See 1, do not keep anything with data you care about plugged in, seriously.
I've put in some input sanitation in there, but it's probably still sloppy enough to make a real programmer cry. Feel free to improve as people see fit.
pushd ~%dp0
echo off
:begin
cls
echo Are you formatting UEFI or MBR?
echo =============
echo.
echo 1) UEFI
echo 2) MBR
echo.
set /p op=Type option:
if "%op%"=="1" goto op1
if "%op%"=="2" goto op1
echo did not recognize input
pause
exit
:op1
cls
echo.
echo.
echo =============
wmic diskdrive get model,deviceid,serialnumber
echo =============
echo.
echo choose which numbered disk to erase (0, 1, 2, etc.)
set /p op2=Type single number only:
if "%op2%"=="" goto op1
cls
echo.
echo.
echo =============
wmic diskdrive get model,deviceid,serialnumber | findstr PHYSICALDRIVE%op2%
echo =============
if %ERRORLEVEL% EQU 1 echo Not a recognized drive, exiting...
if %ERRORLEVEL% EQU 1 pause
if %ERRORLEVEL% EQU 1 exit
echo.
echo Are you sure you want to erase EVERYTHING, including ALL PARTITIONS on this drive?
echo type DELETE in all caps to confirm
set /p op3=Confirm Erase:
if "%op3%"=="DELETE" goto op3
echo no confirmation, exiting...
pause
exit
:op3
if "%op%"=="1" goto uefirun
if "%op%"=="2" goto mbrrun
:mbrrun
@echo select disk %op2% > mbr-diskpart.txt
@echo clean>> mbr-diskpart.txt
@echo create partition primary>> mbr-diskpart.txt
@echo format quick fs=ntfs label="Windows">> mbr-diskpart.txt
@echo assign letter="O">> mbr-diskpart.txt
@echo active>> mbr-diskpart.txt
@echo exit>> mbr-diskpart.txt
diskpart /s mbr-diskpart.txt
echo done, you can now use winntsetup3 to install windows. Boot ^& Install letter is ^<O^>
pause
exit
:uefirun
@echo select disk %op2% > uefi-diskpart.txt
@echo clean>> uefi-diskpart.txt
@echo convert gpt>> uefi-diskpart.txt
@echo create partition efi size=300>> uefi-diskpart.txt
@echo format quick fs=fat32 label="System">> uefi-diskpart.txt
@echo assign letter="N">> uefi-diskpart.txt
@echo create partition msr size=128>> uefi-diskpart.txt
@echo create partition primary>> uefi-diskpart.txt
@echo format quick fs=ntfs label="Windows">> uefi-diskpart.txt
@echo assign letter="O">> uefi-diskpart.txt
@echo exit>> uefi-diskpart.txt
diskpart /s uefi-diskpart.txt
echo done, you can now use winntsetup3 to install windows. Boot letter is ^<N^>, Install Drive is ^<O^>
pause
exit
Well you should really checks the diskpart return code.
@echo off
rem cause an error, by wrong type
> diskpart.txt echo list disks
>>diskpart.txt echo exit
diskpart /s diskpart.txt
IF %Errorlevel%==0 (
echo.
echo done, you can now use winntsetup3 to install windows. Boot letter is ^<N^>, Install Drive is ^<O^>
echo.
pause
) else (
echo.
echo Diskpart had a problem! Exitcode: %Errorlevel%
echo.
pause
)