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-06-23 10:45
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » What does 2>nul 1>nul in batch processing statements mean? DigestI View 29,425 Replies 57
Floor 31 Posted 2007-03-18 03:35 ·  中国 浙江 温州 电信
初级用户
Credits 42
Posts 17
Joined 2005-08-28 14:49
20-year member
UID 42027
Status Offline
Strong post
Can't help but top it
Floor 32 Posted 2007-05-29 17:28 ·  中国 北京 海淀区 IDC机房
初级用户
Credits 50
Posts 19
Joined 2007-05-22 21:13
19-year member
UID 89005
Gender Male
Status Offline
The following is the analysis:

First, "set mhnet=%temp%\mhnet" means to set the variable "mhnet" to the path which is the "temp" folder (a system temporary folder) combined with the subfolder name "mhnet".

Then, "rmdir /S /Q %mhnet% 2>NUL 1>NUL" is to delete the folder and its sub - folders (/S means delete sub - folders recursively, /Q means quiet mode) and redirect the error and output information to null.

Finally, "mkdir %mhnet%" is to create the folder specified by the "mhnet" variable.

So, %mhnet% is a folder path which is the "temp" folder's sub - folder named "mhnet".
Floor 33 Posted 2007-08-31 17:02 ·  中国 江苏 苏州 联通
初级用户
Credits 48
Posts 25
Joined 2007-07-30 17:57
18-year member
UID 94318
Gender Male
Status Offline
Went shopping all day, got quite a haul. :lol:
Floor 34 Posted 2007-09-17 11:34 ·  中国 广东 广州 增城区 电信
新手上路
Credits 4
Posts 2
Joined 2006-09-16 03:20
19-year member
UID 62721
Status Offline
It's too profound. When will I be able to understand it?
Floor 35 Posted 2007-09-18 21:23 ·  中国 上海 浦东新区 电信
初级用户
★★
Credits 150
Posts 68
Joined 2007-04-26 00:18
19-year member
UID 86476
Gender Male
Status Offline
Leave a footprint, digest it slowly in the future~~
Floor 36 Posted 2007-09-19 20:35 ·  中国 四川 德阳 电信
新手上路
Credits 10
Posts 5
Joined 2007-09-19 18:45
18-year member
UID 97814
Gender Male
Status Offline
Awesome
Floor 37 Posted 2007-09-21 19:03 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline

The null device NUL is a special device because it has no controllable PC hardware or ports, but is just a fictional device or port that only exists at the software level. Because of this, it can accept all redirected input and output requests without giving any response. Under NT, it will end the input request without giving any input information. Under DOS, it repeatedly fills 127 binary bytes of 1 (displayed as ^A) and then terminates the response. This characteristic makes it very similar to the "black hole" in astronomy that can devour all matter and information, and also very similar to the "mysterious way" in philosophy that can reverse yin and yang and create from nothing. The reason for its existence is that we need a "recycling bin" that can silently and unconditionally absorb various redundant output information or input requests, just as the "black hole" is like a huge "cosmic garbage dump".


  Precise!......
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 38 Posted 2007-10-05 10:33 ·  中国 浙江 宁波 电信
初级用户
Credits 87
Posts 42
Joined 2007-09-27 19:25
18-year member
UID 98424
Gender Male
Status Offline
Nice
Floor 39 Posted 2007-10-09 19:23 ·  中国 福建 厦门 电信
初级用户
Credits 74
Posts 37
Joined 2007-06-28 11:47
18-year member
UID 92573
Gender Male
Status Offline
Bump
Floor 40 Posted 2007-10-11 01:34 ·  中国 广东 惠州 电信
新手上路
Credits 6
Posts 3
Joined 2006-11-27 08:38
19-year member
UID 71867
Gender Male
Status Offline
Very readable~!
Floor 41 Posted 2007-10-15 17:55 ·  中国 北京 石景山区 联通
新手上路
Credits 6
Posts 3
Joined 2007-10-15 17:15
18-year member
UID 99818
Gender Male
Status Offline
I have always seen such things, and I saw this time
Floor 42 Posted 2007-10-16 18:30 ·  中国 广东 东莞 电信
初级用户
Credits 26
Posts 12
Joined 2007-10-13 18:43
18-year member
UID 99648
Gender Male
Status Offline
A bit too deep, hard to understand.
Floor 43 Posted 2008-01-22 13:15
新手上路
Credits 12
Posts 6
Joined 2008-01-22 12:36
18-year member
UID 109247
Gender Male
From 广东
Status Offline
Nice
Floor 44 Posted 2008-01-30 17:58 ·  中国 香港 新世界电讯
新手上路
Credits 13
Posts 7
Joined 2007-10-04 19:44
18-year member
UID 98894
Gender Male
Status Offline
Great! Save it for later to savor slowly.
Floor 45 Posted 2008-01-31 02:18 ·  中国 贵州 贵阳 电信
初级用户
Credits 97
Posts 45
Joined 2007-01-31 06:02
19-year member
UID 78190
Gender Male
Status Offline
Is there a difference between NUL and NULL? If there is, what is the difference?
Forum Jump: