Copying folders with suffix using .bat script

March 5, 2011 at 00:31:31
Specs: Windows 2000
Hi all,

I've got a large number of folders, all containing data. Some folders had the suffix '_R' added to the end. I'd like to copy just the folders (and content) that have the '_R' suffix. I've tried an xcopy command to specify a wildcard in the source, but that didn't work.

xcopy "C:\RFI\2010\*_R" "C:\Export\" /a /e

Any ideas would be really helpful!


See More: Copying folders with suffix using .bat script

Report •

March 6, 2011 at 00:20:44
:: ==========================================
:: ajt2.bat Sun 06-03-2011 15:17:19.04
@echo off & setLocal enableDELAYedeXpansion

for /f "tokens=* delims= " %%a in ('dir/b/ad *_R') do (
xcopy %%a f:\out\

Life is too important to be taken seriously.


Report •

March 7, 2011 at 02:38:03
Thanks for that, works perfectly!

Report •

Related Solutions

Ask Question