中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-13 22:14
47,812 topics / 349,916 posts / today 0 new / 48,268 members
论坛回收站 » Please provide the specific content of the post with the batch processing that needs to be explained so that I can translate and handle it.
Printable Version  7,358 / 1
Floor1 tclshx Posted 2010-11-20 12:42
中级用户 Posts 64 Credits 249
Please provide the Chinese text that needs to be translated.
Floor2 wewebb Posted 2010-11-20 14:16
初级用户 Posts 53 Credits 66
echo Enter the size of each partition (unit: GB), separated by spaces or commas, and do not enter the last partition:
set size=


Set /P size=Partition sizes:

echo.

::Comment starts from here;
echo Enter "NTFS" or "FAT" to format accordingly, enter "N" or omit to not format:

::Delete the frmt variable
set frmt=

::User enters the value of the frmt variable (NTFS or FAT)
Set /P frmt=:

::Delete the frmt variable
set frmty=

:: The following if statement is to set the values of frmty and ss variables.
:: Among them, the frmty variable stores the parameters of Gdisk32
:: /for is to format the partition; /q is quick format /ntfs specifies the partition format

:: The algorithms for the two partition formats are different. The ss variable stores the base number. It will be used below


If /I '%frmt%'=='ntfs' set frmty=/for /q /ntfs&&set ss=1024
If /I '%frmt%'=='fat' set frmty=/for /q&&set ss=1028-8


echo Starting partitioning, please wait...
echo Partition process information:

::Take out each partition size value entered by the user, up to 9 partitions can be set

for /f "tokens=1,2,3,4,5,6,7,8,9 delims=, " %%c in ("%size%") do (

rem Convert the partition size value entered by the user (GB unit) to MB unit. That is, numerical value * SS variable value
rem For example, for NTFS partition: GB value * 1024

set /A cp=%%c*%ss%

rem The following two lines divide the first primary partition and activate
GDISK32 1 /cre /pri /sz:!cp! %frmty%
GDISK32 1 /act /p:1

rem The following line divides the remaining space into extended partitions
GDISK32 1 /cre /ext

rem The following For loop is to divide logical partitions. Up to eight
for %%i in (%%d,%%e,%%f,%%g,%%h,%%i,%%j,%%k) do (
set /A op=%%i*%ss%
GDISK32 1 /cre /log /sz:!op! %frmty%
))

::Divide the remaining space into a logical partition
GDISK32 1 /cre /log /end %frmty%
echo.
echo Partition completed!

[ Last edited by wewebb on 2010-11-20 at 14:28 ]
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023