この部分のコードに別の命令を追加したい"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:
)
)
私はフォーラムを読んでいて、 && を使用して別のコマンドをすぐに実行できるという言及を見つけました。