Re gmy:
From the way your current program operates, it will always detect all drives from C to W, rather than immediately exiting as soon as a matching drive letter is detected, to avoid issues with unallocated drive letters and possible access to other drives. This is my modified version. Of course, it still can't fundamentally solve the drive letter access problem, just reduces the probability of problems occurring.
@echo off
if "%1"=="" goto ok
cls
for %%i in (c d e f g h i j k l m n o p q r s t u v w) do if exist %%i:\boot.ini %0 %%i
:err
echo Sorry! boot.ini is not found!
goto end
k
echo OK! %1\boot.ini is found !
goto end
:end
echo
echo
pause
※ Batchinger 致 Bat Fans:请访问
批处理编程的异类 ,欢迎交流与共享批处理编程心得!