Solved

Batch File Copy Files and Sub-Folders Help

Posted on 2013-01-04
2
597 Views
Last Modified: 2013-01-04
I need to create a batch file that will backup/copy the entire contents of my Marketing Directory.  My marketing directory contains files and sub-directories with files.  I have used xcopy in the past but it is not picking up any of the sub-directories or their contents.  In the end i would like a batch file to copy the entire directory structure as it is.
0
Comment
Question by:deklinm
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
honestman31 earned 500 total points
ID: 38746125
use this  xcopy sourcepath destinationpath /e

also this one  
XCOPY "C:\Users" "K:\My Vista Backup" /D /E /C /R /I /K /Y

source
http://en.kioskea.net/forum/affich-30405-creating-a-batch-file-to-copy-a-directory
0
 
LVL 10

Expert Comment

by:honestman31
ID: 38746135
@Echo Off 
xcopy c:\source d:\target /s/e
exit 

Open in new window


s means for sub-directories ( recursive )
e means even empty directory
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

895 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