Files
nt-lite/mkimage.bat
T

40 lines
880 B
Batchfile

@echo off
setlocal
set VHD=%~dp0disk.vhd
echo === nt-lite: create disk image ===
echo.
if exist "%VHD%" (
echo Removing old disk.vhd...
del "%VHD%"
)
:: Write a diskpart script to a temp file (avoids pipe/echo escaping issues)
set DPS=%TEMP%\ntlite_mkimg_%RANDOM%.txt
(
echo create vdisk file="%VHD%" maximum=256 type=fixed
echo select vdisk file="%VHD%"
echo attach vdisk
echo create partition primary size=150
echo format fs=fat32 quick
echo create partition primary
echo format fs=fat32 quick
echo detach vdisk
echo exit
) > "%DPS%"
echo Creating 256 MB FAT32 image via diskpart...
diskpart /s "%DPS%"
del "%DPS%"
if exist "%VHD%" (
echo.
echo disk.vhd ready. Run build.bat to populate it.
) else (
echo.
echo ERROR: disk.vhd was not created.
echo Make sure you are running as Administrator.
exit /b 1
)