Solved

robocopy all folders

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

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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 …
AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…

730 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