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-08-12 20:39
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] What does this batch file mean?? View 876 Replies 3
Original Poster Posted 2010-02-04 16:50 ·  中国 广东 江门 电信
初级用户
★★
Credits 167
Posts 95
Joined 2007-05-06 09:19
19-year member
UID 87628
Gender Male
Status Offline
@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~~~
Floor 2 Posted 2010-02-04 21:50 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
subst is used to create virtual partitions; it can't really partition a hard disk.
Floor 3 Posted 2010-02-05 12:57 ·  中国 天津 移动
新手上路
Credits 9
Posts 9
Joined 2009-08-27 23:14
16-year member
UID 151077
Gender Male
Status Offline
Learned something!
Thanks, moderator!
Floor 4 Posted 2010-02-05 13:01 ·  中国 天津 移动
新手上路
Credits 9
Posts 9
Joined 2009-08-27 23:14
16-year member
UID 151077
Gender Male
Status Offline
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
Forum Jump: