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-04 09:04
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to use the Exist subcommand to tell whether there is a disc in the CD-ROM drive? View 834 Replies 2
Original Poster Posted 2007-04-28 04:33 ·  中国 北京 新华社
新手上路
Credits 10
Posts 4
Joined 2007-04-25 23:15
19-year member
UID 86465
Gender Male
Status Offline
My computer has two CD-ROM drives, F: and G:. There is a disc with a Test.txt file placed in its root directory, and I want to determine in a batch file which CD-ROM drive this disc is actually in. When there is no disc in drive F:, executing the following statement causes an error:
if exist f:\nul echo ffff
And it reports the following information:
CDR101:Not ready reading drive F
Abort,Retry,Falt?
I'd like to ask all the experts, how should I avoid this runtime error?
Thanks!
Floor 2 Posted 2007-04-28 04:42 ·  中国 北京 联通
中级用户
★★
替身
Credits 269
Posts 130
Joined 2007-03-23 21:41
19-year member
UID 82683
Gender Female
Status Offline
OP, which system are you using???
Floor 3 Posted 2007-04-28 05:25 ·  中国 北京 新华社
新手上路
Credits 10
Posts 4
Joined 2007-04-25 23:15
19-year member
UID 86465
Gender Male
Status Offline
Thanks for ansipeter's attention! I'm using DOS7.1
. But my problem has already been solved. Thank you
Forum Jump: