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-01 11:14
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Batch file View 1,984 Replies 5
Original Poster Posted 2003-01-23 00:00 ·  中国 福建 福州 教育网
初级用户
Credits 120
Posts 1
Joined 2003-01-23 00:00
23-year member
UID 791
Gender Female
Status Offline
Question:
If I want to check whether a batch file auto.bat exists in a certain directory aaa on a machine A on the network, and if it exists then execute auto.bat, otherwise do nothing, how should this statement be written?
Thanks!
Floor 2 Posted 2003-01-23 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
if not exist \\a\xx\aaa\nul xxxx

Note: please do not post duplicate threads. I already deleted the duplicate posts.
Wengier - 新DOS时代

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

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

Floor 3 Posted 2004-11-14 00:00 ·  中国 山东 济宁 电信
中级用户
★★★
痴迷DOS者
Credits 456
Posts 570
Joined 2004-10-09 00:00
21-year member
UID 32281
Gender Male
Status Offline
DOS不是万能的,没有DOS是万万不能的
自古系统谁无死?留取胆清照汗青!uploadImages/20035317345478982.png
Floor 4 Posted 2004-11-15 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
First, aaa needs to be shared. Then use the following commands: :: map the shared aaa directory to the local machine's X: drive
net use x: \\a\aaa

::check whether the corresponding file exists
if exist x:\auto.bat call x:\auto.bat

::remove the network drive
net use x: /d
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 5 Posted 2004-11-17 00:00 ·  中国 重庆 电信
初级用户
Credits 126
Posts 7
Joined 2004-08-20 00:00
21-year member
UID 30436
Gender Male
Status Offline
版权没有,拷贝自由!
Floor 6 Posted 2004-11-18 00:00 ·  中国 浙江 温州 电信
初级用户
Credits 165
Posts 27
Joined 2004-11-11 00:00
21-year member
UID 33555
Gender Male
Status Offline
Just a reminder to the OP: in your wording, “if it exists then execute auto.bat” means auto.bat gets executed on your own machine, not on his machine. I'm guessing you want to execute auto.bat on his machine. Right? If so, hehe, sorry, then the answers above are all invalid!~~~~
Forum Jump: