我想在这部分为这段代码添加另一条指令,"if exist "%%d:\%folder%\" (echo Device was found on %%d:)"
所以如果找到该文件夹,它也set folderfound="%%d:\%folder%\"
可以做类似的事情吗?这是完整的代码来显示我想要做什么
:autodetect1
set /p "folder=Folders Name that the photo's are in: "
setlocal
set folder=%1
if "%folder%" == "" call :autodetect1
cls
for %%d in (d e f g h i j k l m n o p q r s t u v w x y z) do (
if exist "%%d:\%folder%\" (
echo Device was found on %%d: and set folderfound=%%d:\%folder%\
) else (
echo Device was not found on %%d:
)
)
我在论坛上阅读,我发现提到你可以使用 && 直接执行另一个命令我可以在 if 存在中使用它吗?