@echo off if "%1"=="x" goto noformcmd if "%1"=="X" goto noformcmd format %1 %FORMCMD% %2 %3 %4 %5 %6 %7 %8 %9 if errorlevel 1 goto error goto end :noformcmd shift format %1 %2 %3 %4 %5 %6 %7 %8 %9 if errorlevel 1 goto error goto end :error echo The disk could not be formatted! :end