@echo off
rem 查找名称中含有指定字符串/关键字的文件夹
set #=Any question&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$% %z%
cd /d "%~dp0"
set "keyword=YCRSJCS"
set "outfile=D:\xxx.txt"
type nul>"%outfile%"
for %%a in (Z Y X W V U T S R Q P O N M L K J I H G F E D C B A) do (
if exist "%%a:\" (
echo;---------[%%a: searching...]---------
set n=0
for /f "delims=" %%b in ('dir /ad/b/s "%%a:\*%keyword%*"') do (
echo;%%b
>>"%outfile%" echo;%%b
set /a n+=1
)
setlocal enabledelayedexpansion
echo;!n!
endlocal
)
)
pause
exit
@echo off & title 列出指定字符串的文件夹路径 By 依梦琴瑶
(for %%a in (C D E F G) do (
pushd "%%~a:\"
for /f "delims=" %%b in ('dir /ad/s/b "*YCRSJCS*"') do (
echo "%%~b"
)
popd
))>指定字符串文件夹路径.txt