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-03 22:47
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to suppress error messages in a statement like this View 636 Replies 1
Original Poster Posted 2007-04-02 17:10 ·  中国 香港 腾讯云
初级用户
Credits 110
Posts 41
Joined 2007-03-31 17:20
19-year member
UID 83521
Gender Male
Status Offline
Mainly for the error message shown when the dir command can't find a file, how can it be suppressed?!

for /f "tokens=3" %%c in ('dir /a:-d/s/-c/w c:\*.ljl^|find "File(s)"') do (
set allfilesize=%%c
)
Floor 2 Posted 2007-04-02 22:05 ·  中国 江苏 苏州 联通
银牌会员
★★★
Credits 1,181
Posts 533
Joined 2006-08-14 12:54
19-year member
UID 60484
Status Offline
dir/b c:\###.###
dir/b c:\###.### 2>nul

Try this method
Forum Jump: