?
Solved

robocopy all folders

Posted on 2007-11-17
1
Medium Priority
?
1,221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

765 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