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-15 15:49
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » Does "if (not) exist" not be able to be used with *.*? View 1,888 Replies 2
Original Poster Posted 2010-12-04 15:10 ·  中国 广东 惠州 电信
新手上路
Credits 18
Posts 11
Joined 2006-08-17 22:20
19-year member
UID 60748
Status Offline
Running `if exist a\*.* echo right` result:
Echoes "right" regardless of whether a is an empty directory
Running `if not exist a\*.* echo wrong` result:
If a is an empty directory, there is no echo; if a is a non-empty directory, it echoes "error"

It seems that `if (not) exist` cannot be used with `*.*`. What is the reason for this?

[ Last edited by crist on 2010-12-4 at 15:16 ]
Floor 2 Posted 2010-12-30 17:17 ·  中国 福建 厦门 电信
高级用户
★★★
Credits 741
Posts 366
Joined 2007-07-25 19:11
19-year member
UID 94024
Gender Male
Status Offline
if not exist a\*.*
This is a sentence that doesn't make logical sense by itself...
Floor 3 Posted 2011-01-01 22:35 ·  中国 湖北 天门 电信
中级用户
★★
Credits 208
Posts 135
Joined 2009-09-12 12:00
16-year member
UID 151902
From 离恨天
Status Offline
Make a mark to prevent similar mistakes.
Forum Jump: