
CODE: [Copy to clipboard]或者if exist a.txt if exist b.txt set _filexist=true
if "%_fileexist%"=="true" echo 文件都存在
if not "%_fileexist%"=="true" echo 文件不都存在
set _fileexist=
CODE: [Copy to clipboard]或者if not exist a.txt echo 不存在a.txt
if not exist b.txt echo 不存在b.txt
if exist a.txt if exist b.txt echo 文件都存在
CODE: [Copy to clipboard]或者(只在WinNT系列的CMD下有效)if exist a.txt if exist b.txt goto filexist
echo 文件不都存在
goto end
:filexist
echo 文件都存在
:end
CODE: [Copy to clipboard]if exist a.txt if exist b.txt (echo 文件都存在) else (echo 文件不都存在)
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |