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-25 13:04
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » How to determine whether a certain folder under a certain drive letter exists??? [Help] View 1,800 Replies 8
Original Poster Posted 2002-12-07 00:00 ·  中国 北京 联通
银牌会员
★★★
Credits 1,225
Posts 461
Joined 2002-10-22 00:00
23-year member
UID 39
Gender Male
Status Offline
For example:
I want to know whether the C:\ABC folder exists. How should I judge it under DOS?

Does IF EXIST only judge files and not folders?
Floor 2 Posted 2002-12-07 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Just use IF EXIST C:\ABC\NUL.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 3 Posted 2002-12-07 00:00 ·  中国 北京 联通
银牌会员
★★★
Credits 1,225
Posts 461
Joined 2002-10-22 00:00
23-year member
UID 39
Gender Male
Status Offline
I'll try!!!

It worked! Haha!

Thank you, moderator!!
Floor 4 Posted 2002-12-07 00:00 ·  中国 北京 联通
银牌会员
★★★
Credits 1,225
Posts 461
Joined 2002-10-22 00:00
23-year member
UID 39
Gender Male
Status Offline
Still need to trouble you!!!
/NUL
What does this parameter mean?
Floor 5 Posted 2002-12-07 00:00 ·  中国 湖北 随州 电信
元老会员
★★★
Credits 1,987
Posts 632
Joined 2002-10-27 00:00
23-year member
UID 73
Gender Male
Status Offline
In fact, you can also use IF EXIST C:\abc\. or IF EXIST C:\abc\*.*
In addition, the software LOCATE is the most powerful for finding directories and files.
http://dos.e-stone.cn/dosbbs
uploadImages/200311161145850422.swf
Floor 6 Posted 2002-12-07 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
It's like this.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 7 Posted 2002-12-07 00:00 ·  中国 北京 联通
银牌会员
★★★
Credits 1,225
Posts 461
Joined 2002-10-22 00:00
23-year member
UID 39
Gender Male
Status Offline
The following is a quote from yiyesong on December 7, 2002 at 1:57:33:
In fact, you can also use IF EXIST C:\abc\. or IF EXIST C:\abc\*.*
In addition, the software LOCATE is the most powerful for finding directories and files.


It doesn't work!!
The above is only effective when there are files in the directory
It has no effect on empty directories!!!!

/NUL can judge empty directories!!!

So please talk about./NUL.... Thank you!
Floor 8 Posted 2002-12-07 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
In pure DOS, ABC\*.* may not be effective when there are no files, but it is effective under DOS32. NUL is used to determine whether the null device exists.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 9 Posted 2002-12-07 00:00 ·  中国 北京 联通
银牌会员
★★★
Credits 1,225
Posts 461
Joined 2002-10-22 00:00
23-year member
UID 39
Gender Male
Status Offline
Oh!
Forum Jump: