China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-29 07:58
中国DOS联盟论坛 » 论坛回收站 » 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. View 7,218 Replies 1
Original Poster Posted 2010-11-20 12:42 ·  中国 贵州 黔西南布依族苗族自治州 电信
中级用户
★★
Credits 249
Posts 64
Joined 2005-06-03 00:00
21-year member
UID 39315
Gender Male
Status Offline
Please provide the Chinese text that needs to be translated.
Floor 2 Posted 2010-11-20 14:16 ·  中国 广东 广州 联通
初级用户
★★
Credits 66
Posts 53
Joined 2009-10-09 20:51
16-year member
UID 152852
Gender Male
Status Offline
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 ]
Forum Jump: