looping operations on files within folders

September 14, 2010 at 05:27:41
Specs: Windows XP
First of all thank you all for all the usefull tips, hints and solutions I've found on this forum!

I've been wondering if it is possible to loop these operations? There is plenty of files under these directories:

set folderOne="C:\TEMP\folderOne"
set folderTwo="C:\TEMP\folderTwo"
set folderThree="C:\TEMP\folderThree"
set folderFour="C:\TEMP\folderFour"


copy %folderTwo%\*.DAT %folderTwo%\ARCH\*.DAT
copy %folderOne%\*.DAT %folderOne%\ARCH\*.DAT
copy %folderThree%\*.DAT %folderThree%\ARCH\*.DAT
copy %folderFour%\*.DAT %folderFour%\ARCH\*.DAT


ren %folderTwo%\*.DAT *.ACK
ren %folderOne%\*.DAT *.ACK
ren %folderThree%\*.DAT *.ACK
ren %folderFour%\*.DAT *.ACK


for /f "tokens=*" %%a in ('dir "%folderOne%\*.ACK" /b') do (
> %%a echo Acknowledgment file)
for /f "tokens=*" %%a in ('dir "%folderTwo%\*.ACK" /b') do (
> %%a echo Acknowledgment file)
for /f "tokens=*" %%a in ('dir "%folderThree%\*.ACK" /b') do (
> %%a echo Acknowledgment file)
for /f "tokens=*" %%a in ('dir "%folderFour%\*.ACK" /b') do (
> %%a echo Acknowledgment file)

Many thanks


See More: looping operations on files within folders

Report •

#1
September 14, 2010 at 11:20:15
well i'm not getting what you want but:
:top
yourscript
goto top


kinda...


Report •
Related Solutions


Ask Question