Code: Select all
@ECHO OFF
IF NOT "%OS%"=="Windows_NT" GOTO :EOF
REM *********************************************************************
SET ZLS=C:\ZLIST.ZLS
REM *********************************************************************
SET DRSPEC=C D E F G H I J K L M N O P Q R S T U V W X
SET FSPEC1=*GO*.*
SET FSPEC2=TA
TYPE NUL > %ZLS%
FOR %%U IN (%DRSPEC%) DO (
IF EXIST %%U: (
%%U:
CD\
FOR /F "TOKENS=*" %%V IN ('DIR "%FSPEC1%" /A-D /B /S') DO (
REM ------------------------------------------
REM ------------------------------------------
ECHO %%~nV%%~xV | FIND /I "%FSPEC2%" >NUL
REM ------------------------------------------
REM ------------------------------------------
IF NOT ERRORLEVEL 1 (
ECHO "%%~fV">>%ZLS%
ECHO %%~fV
SET /A C1=C1+1
)
)
)
)
ECHO ------------------------
ECHO numbers of files are %C1%
PAUSE
Code: Select all
AA=ECHO %%~nV%%~xV | FIND /I "%FSPEC2%" >NUL
without the line AA= a whole drive spectrum to find files with only one "SET FSPEC1=*GO*.*" takes about 30~40 seconds for maybe 400,000 files.
but with AA=, and with the 2nd "SET FSPEC2=TA" on, a search gets stuck on F: that has one directory that has many sub dir's with 90,000 files, and without F: in the search list, a 2 string search takes about 20 minutes, and i think that "| FIND" works too slow to be useful, and i like to know why it is, and maybe you can change my script to make it better, i need this 2 string search script.