标题: [求助]:也是关于 IF EXLE 嵌套的问题 [打印本页] 作者: rjn2307 时间: 2007-10-13 16:10 标题: [求助]:也是关于 IF EXLE 嵌套的问题
WINDOWS XP 意思是当二个条件均满足时set Y=bbb,否则set Y=aaa,并执行相应的任务,下列脚本已可满足,问题是能否将二条命令合并为一条,即将set Y=aaa插入 if 行中,也可实现上述目的....
set Y=aaa
if not exist C:\a (call :a) else (if not exist c:\c.exe (call :c) else (set Y=bbb)
pause
谢谢!
[ Last edited by rjn2307 on 2007-10-13 at 04:17 PM ]作者: junchen2 时间: 2007-10-13 16:23 if not exist C:\a (call :a & if not exist c:\c.exe set Y=aaa) else (if not exist c:\c.exe (call :c) else set Y=bbb)
pause
[ Last edited by junchen2 on 2007-10-13 at 04:41 PM ]作者: rjn2307 时间: 2007-10-13 18:51 谢谢回复:
i但我想与其用两次 f not exist c:\c.exe
还不如用两次 set Y=aaa 了
if not exist C:\a (set Y=aaa&call :a) else (if not exist c:\c.exe (set Y=aaa&call :c) else (set Y=bbb)作者: lxmxn 时间: 2007-10-13 21:19
set x=d:\Windows
set Y=只有一个
if not exist %X%\Notepad.exe (set Y=%y%ime) else (if not exist %X%\ime (set Y=%y%Notepad) else (set Y=两个都有))
echo %y%
pause