Copy files and delete files copied from sourc

Microsoft Windows server v2003 r2 standa...
March 4, 2010 at 12:55:51
Specs: Server 2003
I have a folder with mutliple sub folders give a date for a name, e.g 04_March_2010. I need to copy all the dated folders, except for the current dates folder and then delete the folders that were copied from the source.

I can currently copy all the folders except using current dates one by using the

"XCOPY souce dest /EXCLUDE:exlude.txt"

The exlude.txt has the current date format in it, eg 04_March_2010.

So if the source folder had the following files in it:


the folders 01_March_2010, 02_March_2010 and 03_March_2010 would be copied and 04_March_2010 would't.

I can't work out how then to delete the folders copied, 01_March_2010, 02_March_2010 and 03_March_2010 without deleting all the folders in the source directory. Is there a way I can do this with XCOPY or ROBOCOPY?

My DOS version is 5.2.3790 running Server 2003 Standard.

Thanks for any help.

See More: Copy files and delete files copied from sourc

Report •

March 4, 2010 at 22:54:00
Pipe it to a log and use the log.

xcopy src dest | find /v "copied" >> log

Helping others achieve escape felicity


Report •
Related Solutions

Ask Question