set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
> "%scriptFile%" (
echo LIST DISK
echo SELECT DISK %diskfind%
echo LIST PART
echo SEL PART 1
echo FORMAT QUICK FS=%diskstr% LABEL="Ventoy"
echo ASSIGN LETTER=%ntfsdrive%
)
type "%scriptFile%" >nul
echo.
diskpart /s "%scriptFile%" >nul
del /q "%scriptFile%" >nul
:continue
set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
> "%scriptFile%" (
echo LIST DISK
echo SELECT DISK %diskfind%
echo LIST PART
echo SEL PART 1