Computer Forum Forum Index
Register  FAQ Profile Log in to check your private messages Log in Register 

Get list of files in specified directories

 
Post new topic   Reply to topic    Computer Forum Forum Index -> windowsxp general
View previous topic :: View next topic  
Author Message
MVB
Guest





PostPosted: Tue Dec 18, 2007 9:14 am    Post subject: Get list of files in specified directories Reply with quote

Hi All,
I want to get a list of files from specified list of folders. I have
written following script but it is not working.
--------------------------------------------------------------------------------------------------------------------------------------
@echo off
SetLocal EnableExtensions EnableDelayedExpansion
rem # List of folders to be serched
set FOLDER_ARRAY=abc, def, xyz

rem # Get the folder list
FOR %%G IN (%FOLDER_ARRAY%) DO (
set folder=%%G

rem # Find files as *.orig in the specified folder
FOR /R !folder! %%F IN (*.orig) DO (
echo %%F
)
)
endlocal
--------------------------------------------------------------------------------------------------------------------------------------
In above script if I "echo !folder!" it is giving proper results but
it is not expanding properly in the second for loop.
Can anyone help me in this.
Thanks
MVB
Back to top
Google
Sponsor





PostPosted: Tue Dec 18, 2007 9:14 am    Post subject: Advertisement

Back to top
Anteaus
Guest





PostPosted: Tue Dec 18, 2007 10:33 am    Post subject: RE: Get list of files in specified directories Reply with quote

dir *.* /b /s >filelist.txt
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Computer Forum Forum Index -> windowsxp general All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Computer Forum