You are not logged in.
I am looking for a more efficient method of recursing sub-directories with the FOR command, since FOR /R is not available in NT4/W2000.
I am using the following to process 25,000+ files in ~2500 sub-directories:
1- determine next sub-dir to process, FOR /F
2- move sub-dir to process folder
3- determine next filename in sub-dir to process until no more files, FOR /F
repeat until no more sub-dirs.
------
:: get sub-dir
FOR /F "delims=" %%i IN ('dir /b *.*') DO SET sub_dir=%%i
IF "%sub_dir%"=="" goto end
------
------
:: get filename
FOR /F "delims=" %%h IN ('dir /b %temp_dir%\%sub_dir%\*.*') DO SET filename=%%h
IF "%filename%"=="" goto process_done
------
It is a long process, as the DIR command must scroll through 2500 sub-directories before finding the next sub-dir to process.
Offline
I don't have a Windows 2000 VM available, but did dir have the /S option yet?
Offline
Yes, dir /s is available in NT4/W2000.
/s: displays files in specified directory and all sub-dirs.
Offline
Well there you go.
for /f "delims=" %%I in ('dir /b /s *.*') do call :process_file %%I
Offline
That is interesting, thank you. I will see if I can get that to work for me.
Offline