更新时间:2023-11-28 09:41:28
使用 IF EXIST 或 IF NOT EXIST 组合:
:FindDrive
if exist Z:\nul goto Mounted
timeout /T 5
goto FindDrive
:Mounted
NUL是每个文件夹中都存在的虚拟"文件.因此,如果c:\ anypath \ nul存在,则驱动器存在.
NUL is the a 'virtual' file that exists in every folder. So if c:\anypath\nul exists, the drive exists.