中国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-08-12 19:44
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » [Help] What does this batch file mean??
Printable Version  875 / 3
Floor1 ldr2zjj Posted 2010-02-04 16:50
初级用户 Posts 95 Credits 167
@echo off
echo Please wait... adding hard disk partitions for you..................
md d:\fly >nul 2>nul
set a=c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
for %%a in (%a%) do subst %%a: d:\fly >nul 2>nul
echo\
echo Open "My Computer" and take a look.........is it enough for you..........
ping 127.1 -n 5 >nul
exit





@echo off&color 1e
title Please wait... restoring hard disk partitions for you..................
set a=c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
for %%a in (%a%) do subst %%a: /d
echo\
cls&echo Thank you for usingping 127.1 -n 3 >nul
exit



I was just thinking of learning how to use batch files to partition a hard disk~~ can someone help explain this~~~
Floor2 HAT Posted 2010-02-04 21:50
版主 Posts 5,017 Credits 9,023
subst is used to create virtual partitions; it can't really partition a hard disk.
Floor3 jobszheng5 Posted 2010-02-05 12:57
新手上路 Posts 9 Credits 9
Learned something!
Thanks, moderator!
Floor4 jobszheng5 Posted 2010-02-05 13:01
新手上路 Posts 9 Credits 9
Command: subst
Function: associates a path with a drive letter.

Format: SUBST [drive1: [drive2:]path]
SUBST drive1: /D

Explanation: drive1: specifies the virtual drive to which you want to assign a path.
[drive2:]path specifies the physical drive and the path to assign to the virtual drive.
/D deletes the substituted (virtual) drive.

If you type SUBST without any parameters, it displays a list of the current virtual drives.

—quoted from the CMD help document
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023