Can the search files batch files also output the files path?

August 24, 2017 at 09:09:30
Specs: Windows 7
Hi thebest123456,

When I search for the batch script do the work just like this topic, I found this one although it was old. And I tried the best answer script. It works. And I also tested with my samples. Here is what I found:

1) WHEN I my list file has one not in the folders search for, it will output a log file with this not found one file in this log file
2) IF I move out this file, it search exactly all and output the new lists.txt file with exactly all files as ones before I run the script.

This was probably the original request.
Now my request will be case 2). if searched all and can this new lists.txt having all files with their path searched as well?


here was the original code by thebest123456:
thebest123456 November 9, 2012 at 13:27:04
@echo off & setlocal enabledelayedexpansion
type nul> %tmp%\log.txt
set log=%tmp%\log.txt
set list=C:\Users\Username\Documents\Lists\lists.txt
set cnt=0
set number=0
for /f "delims=" %%a in ('type %list%') do (
set /A cnt +=1
set file!cnt!=%%a
)
X:
cd X:\CountyLTmaps\Texas\Grimes\Lease Images
:LOOP
if %number%==%cnt% exit /b
set /A number +=1
dir /s !file%number%! || echo.!file%number%!>> %tmp%\log.txt
Goto :LOOP

message edited by goodywp


See More: Can the search files batch files also output the files path?

Reply ↓  Report •
Related Solutions


Ask Question