@mode con: cols=33 lines=5 >nul 2>nul
@echo off
@color 001f
@cls
title ★分區大小計算★ (GB轉MB)
:main
@color 001f
cls
@echo.
@echo 請輸入分區大小 (以^"GB^"為單位) :
@echo ================================
@set /p GB= GB^=
@if %GB% gtr 10240 goto errlevel
@if %GB% lss 1 goto errlevel
@set /a MB=(%GB%-1)*4+1024*%GB%
cls
@echo.
@echo 轉換為 MB單位後,大小該為:
@echo --------------------------------
set "b= %MB% MB"
call:NUB 001c "%b%" 0
call:NUB 0011 "%b%" 0
del /q "%Tmp%\%b%"
pause>nul
goto main
:errlevel
cls
@color 001c
@echo.
@echo.
@echo 程序只支授 1-10240/GB 以內運算
pause>nul
goto main
:NUB
Pushd %Tmp%
echo.>%2
>%2,set/p=<nul
findstr /a:%1 .* "%~2*"