Nonsense not to say, directly on the code, the amount, if you want to use, you can save yourself into a bat file.
"Scheme one" for/f + dir
@echo off
rem Specify the file to search for the
set "Filename=bathome_batcher.txt"
Echo is searching, please wait ...
For%%a in (C 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%%a:\ (
for/f "delims="%%b in (' dir/a-d/s/b '%%a:\*%filename% ' 2^>nul ') do (if/i "%%~NXB" equ "%filename%")
(
echo,%%b)))
"Scheme II" for/r (more efficient than for/f + dir, but does not traverse hidden files)
@echo off
rem Specify the file to search for the
set "Filename=bathome_batcher.txt"
Echo is searching, please wait ...
For%%a in (C 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%%a:\ (
pushd%%a:\
for/r%%b in (*%filename%) do (if/i "%%~NXB"
equ "%filename%" (
echo,%%b
)
)
popd
)
)
"Scenario three" WMIC (Win2000/winxp home version, WinXP Lite version may not be supported)
@echo off
rem Specify the file to search for the
set "Filename=bathome_batcher.txt"
Echo is searching, please wait ...
For%%a in ('%filename% ') do (
set "Nname=%%~na"
Set "Xname=%%~xa"
)
Set "xname=%xname:~1%"
for/f " Skip=1 delims= "%%a in" (' WMIC datafile where ' filename= '%nname% ' and extension= ' ' ' "' Get Name ') does (
%xname% 1/>)
"Scenario Four" uses the where command with the WINDOWS7 system
@echo off
rem Specify the file to search for the
set "Filename=bathome_batcher.txt"
Echo is searching, please wait ...
For%%a in (C 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%%a:\ (
for/f "delims="%%b in ("Where/r%%a:"%filename% "2^>nul") Do (
if/i "%%~NXB" equ "%filename%" (
e) cho,%%b)))