Link to home
Start Free TrialLog in
Avatar of Sumesh BNR
Sumesh BNRFlag for India

asked on

script/batch file to copy some selected folders using robocoy or xcopy

I am looking for a script/batch file  to copy some selected folders using robocoy or xcopy my source folder structure ; the main folder is CODE under the CODE folder there are sub folders as 01 ,02 and so on around 500 folders.I want to copy some specific folders say 2010_10_21 and 2010_10_22 from  inside each subfolders to a destination directory called \\myserver\CODE_2010_10 with the source folder structure each subfolder have folders nmed other dates so the scrip t need to select the two dated folders only .please help.


Avatar of Coast-IT
Coast-IT
Flag of United Kingdom of Great Britain and Northern Ireland image

why not use a different program like total commander?

Just google it, this will give you what you need in GUI format.
Use following command for xcopy.

xcopy /e /h /r /y "SourceFolder" "DestinationFolder"

Thanks
Saugata
Avatar of Sumesh BNR

ASKER

No I need a script
Try this..

Thanks
Saugata
@echo off
set source=Type here your full source path
set destination=Type here your full destination path
xcopy /e /h /r /y "%source%" "%desstination%"

Open in new window

how to loop for 500 sub-folders 01,02,03 and so on?
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good job
Avatar of Bill Prew
Bill Prew

Glad that helped, thanks.

~bp