hi every dostips batch expert..
need some simple help here on how to list out files in full path to excel BUT excluding files in subfolders!
for example,
c:\document\reports\file01.doc
c:\document\reports\file02.doc
c:\document\reports\submitted\file03.doc
c:\document\reports\submitted\file04.doc
i use the below scripts to list out the wanted *.doc but i don't need the one
in the subfolders.. so what's the mistake with the scripts below!! thanks.
SET location="c:\document\reports"
DIR /S /B %location%\*.doc>> listout.xls
PS. I need the full path of the wanted files so that the listout.xls will be just like below,
listout.xls
----------------content-----------------
c:\document\reports\file01.doc
c:\document\reports\file02.doc
------------------end-------------------
THANKS
List files in full path BUT excluding files in subfolders!!!
Moderator: DosItHelp
Re: List files in full path BUT excluding files in subfolder
Code: Select all
set "location=c:\document\reports"
for %%i in ("%location%\*.doc") do echo %%i>> listout.xls