Hello All Expert,
Looking for a batch file which should copy all folders & files except few to another named folder .
Lets say I have folder1 having 3 folders A , B , C and 2 file1 , file2 where each folder A, B and C has some more files & folders.
So I need to copy entire content of A , B and File1 to another folder leaving folder C and file2.
Could someone please advise Many thanks.
Batch file to copy folders & files except few
Moderator: DosItHelp
-
- Posts: 240
- Joined: 04 Mar 2014 11:14
- Location: germany
Re: Batch file to copy folders & files except few
Hello anupam,
With xCopy /s folder1\file1 destination /exclude:list.txt
.. you can give a list with excluded paths.
See also xCopy /?
Phil
With xCopy /s folder1\file1 destination /exclude:list.txt
.. you can give a list with excluded paths.
See also xCopy /?
Phil
Re: Batch file to copy folders & files except few
Pieh's suggestion is great because it's cleaner as you can include your exclusions in a file. but this also works if you dont have many:
Code: Select all
ROBOCOPY /E "%SOURCE%" "%TARGET%" /XD Logs Errors Files /XF *.log *.err *.txt