Solved

robocopy all folders

Posted on 2007-11-17
1
1,215 Views
Last Modified: 2008-02-01
I have a script that copies a main folder and I am using robocopy.exe.

I want to copy all the folders within the main folder except one, which is " _ALL ".

How do I rewrite the script?

********************************************************************************
@echo off
echo.
cls
echo.
echo This script will backup the external harddrive!
echo.
pause
echo.
echo.
robocopy e:\mainfolder c:\_backup\mainfolder /mir /r:5 /w:10
echo Copying mainfolder files
echo.
pause
exit
0
Comment
Question by:CMILLER
1 Comment
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 20304162
You can define folders to exclude with /xd <folders>:
robocopy e:\mainfolder c:\_backup\mainfolder /xd "_ALL" /mir /r:5 /w:10
Note that you can use the /L switch for testing with which robocopy will only log/report the files it would otherwise copy, but doesn't actually copy anything.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question