Posted: Tue Dec 18, 2007 9:14 am Post subject: Get list of files in specified directories
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
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