bat文档语句
来源:百度知道 编辑:UC知道 时间:2024/06/04 14:54:37
如果我希望x盘(虚拟光驱盘)存在,则运行x盘的123.exe,如不存在,则打开d盘的123.iso
可以吗?怎么写?
可以吗?怎么写?
X盘不确定 自动搜索
for /f "skip=1" %%1 in ('wmic logicaldisk where "drivetype=5" get name')do set wind=%%1
if exist "%wind%\123.exe" (start "" "%wind%\123.exe")else start "" "D:\123.iso"
@echo off
if exist x: (start "" x:\123.exe) else (start "" d:\123.iso)
pause