Solved

robocopy all folders

Posted on 2007-11-17
1
1,212 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 82

Accepted Solution

by:
oBdA earned 500 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now