format script improved

This commit is contained in:
Michael H.G. Schmidt 2022-09-25 13:12:13 +02:00
parent a0bce5123b
commit 35e0056405

View File

@ -41,6 +41,7 @@ set DISK=
set FS= set FS=
:askfs :askfs
echo.
set /p FS="Please select filesystem (exfat or fat32) [exfat]: " set /p FS="Please select filesystem (exfat or fat32) [exfat]: "
if /i "%FS%" EQU "fat32" ( if /i "%FS%" EQU "fat32" (
GOTO CONT2 GOTO CONT2
@ -57,6 +58,27 @@ set FS=
:CONT2 :CONT2
echo selected: %FS% echo selected: %FS%
set SIZE=
:asksize
echo.
echo IMPORTANT: maximum size for FAT32 is 32768!
set /p SIZE="Please enter size in MB [max]: "
if /i "%SIZE%" EQU "" (
GOTO CONT3
)
echo %SIZE%| findstr /r "^[1-9][0-9]*$">nul
if %errorlevel% neq 0 (
echo Please enter an integer number!
goto asksize
) else (
echo selected size = %SIZE% [MB]
set SIZE=size=%SIZE%
)
:CONT3
echo.
set LABEL= set LABEL=
set /p LABEL="Please enter a label for the new disk: " set /p LABEL="Please enter a label for the new disk: "
@ -85,7 +107,7 @@ rem =====
@echo.select disk %DISK% @echo.select disk %DISK%
@echo.clean @echo.clean
@echo.convert MBR @echo.convert MBR
@echo.create partition primary @echo.create partition primary %SIZE%
@echo.select partition 1 @echo.select partition 1
@echo.format fs="%FS%" LABEL="%LABEL%" quick @echo.format fs="%FS%" LABEL="%LABEL%" quick
@echo.active @echo.active