display full path when only certain files are searched
Posted: 02 Apr 2010 06:47
hi every dostips scripters !
how do you display ONLY the full path of the certain files search??
for example,
random_list.txt
------------------content------------------
jan10reports.doc
once a girl.avi
smiley.jpg
new robots.pdf
.....etc
------------------end content--------------
search_list.txt
------------------content------------------
smiley.jpg
new robots.pdf
------------------end content--------------
script.bat
----------------code start------------------
@echo off
for /f %%a in ('findstr /g:search_list.txt random_list.txt) do dir /s /b %%a > fullpath.txt
^ i know the above code is wrong, miss out the directory to search on too!
need help with the batch script.bat
so that the result will be like below,
fullpath.txt
------------------content---------------------
c:\pictures\2010\msn\smiley.jpg
d:\technology\2010\books\new robots.pdf
------------------content end-----------------
thanks!!!
how do you display ONLY the full path of the certain files search??
for example,
random_list.txt
------------------content------------------
jan10reports.doc
once a girl.avi
smiley.jpg
new robots.pdf
.....etc
------------------end content--------------
search_list.txt
------------------content------------------
smiley.jpg
new robots.pdf
------------------end content--------------
script.bat
----------------code start------------------
@echo off
for /f %%a in ('findstr /g:search_list.txt random_list.txt) do dir /s /b %%a > fullpath.txt
^ i know the above code is wrong, miss out the directory to search on too!
need help with the batch script.bat
so that the result will be like below,
fullpath.txt
------------------content---------------------
c:\pictures\2010\msn\smiley.jpg
d:\technology\2010\books\new robots.pdf
------------------content end-----------------
thanks!!!