@echo off
setlocal enabledelayedexpansion
set "aa_dir="
for %%a in (F E D C) do (
for /f "delims=" %%i in ('dir /a /b /s "%%a:\avp.exe" 2^>nul') do if not defined aa_dir set aa_dir=%%~dpi
)
start "" %aa_dir%
pause
The meaning is: First, turn off the echo of commands. Then enable delayed variable expansion. Initialize the variable aa_dir to an empty string. Then loop through drives F, E, D, C. For each drive, use the dir command to search for avp.exe in all directories and subdirectories. If aa_dir is not defined, set aa_dir to the drive and directory path where avp.exe is found. Then start the program located in aa_dir. Finally, pause to keep the window open.
setlocal enabledelayedexpansion
set "aa_dir="
for %%a in (F E D C) do (
for /f "delims=" %%i in ('dir /a /b /s "%%a:\avp.exe" 2^>nul') do if not defined aa_dir set aa_dir=%%~dpi
)
start "" %aa_dir%
pause
The meaning is: First, turn off the echo of commands. Then enable delayed variable expansion. Initialize the variable aa_dir to an empty string. Then loop through drives F, E, D, C. For each drive, use the dir command to search for avp.exe in all directories and subdirectories. If aa_dir is not defined, set aa_dir to the drive and directory path where avp.exe is found. Then start the program located in aa_dir. Finally, pause to keep the window open.

