Solved

robocopy all folders

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

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 …
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

687 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