![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-23 13:03 |
47,812 topics / 349,917 posts / today 0 new / 48,273 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] Batch file |
| Printable Version 2,074 / 5 |
| Floor1 xiao98 | Posted 2003-01-23 00:00 |
| 初级用户 Posts 1 Credits 120 | |
|
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! |
|
| Floor2 Wengier | Posted 2003-01-23 00:00 |
| 系统支持 Posts 10,521 Credits 27,736 | |
|
if not exist \\a\xx\aaa\nul xxxx
Note: please do not post duplicate threads. I already deleted the duplicate posts. |
|
| Floor3 defrag | Posted 2004-11-14 00:00 |
| 中级用户 Posts 570 Credits 456 | |
| Floor4 Climbing | Posted 2004-11-15 00:00 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
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 |
|
| Floor5 cqbbsyyl | Posted 2004-11-17 00:00 |
| 初级用户 Posts 7 Credits 126 | |
| Floor6 ultralqxq | Posted 2004-11-18 00:00 |
| 初级用户 Posts 27 Credits 165 | |
|
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!~~~~
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |