XCOPY Routine

Posted on 2014-03-04
Last Modified: 2014-03-04
Hello Experts,  I am currently running an xcopy routine to back up files from my server to another machine.  However when it copy's the files from one directory it only copy's about half of the directories contained in that folder.  The directory with the problem is called home.  Attached is the xcopy script that I am running.  Any ideas as to why it only copies some of the directories would be greatly appreciated.  Thanks!
xcopy \\PSIDC1\PSI\data\access\*.md? \\PSIBACKUP\psi\data\access\ /y/s/h/d
xcopy \\PSIDC1\HR\data\access\*.md? \\PSIBACKUP\psi\data\access\ /y/s/h/d
xcopy \\PSIDC1\PSI\data\access2003\*.md? \\PSIBACKUP\psi\data\access2003\ /y/s/h/d
xcopy \\PSIDC1\PSI\data\labels\*.* \\PSIBACKUP\psi\data\LABELS\ /y/s/h/d
xcopy \\PSIDC1\PSI\data\Word\*.* \\PSIBACKUP\psi\data\Word\ /y/s/h/d
xcopy \\PSIDC1\PSI\data\excel\*.* \\PSIBACKUP\psi\data\excel\ /y/s/h/d
xcopy \\PSIDC1\PSI\data\powerpoint\*.* \\PSIBACKUP\psi\data\powerpoint\ /y/s/h/d
xcopy \\PSIDC1\PSI\data\Project\*.* \\PSIBACKUP\psi\data\project\ /y/s/h/d
xcopy \\PSIDC1\PSI\data\QS9000\*.* \\PSIBACKUP\psi\data\QS9000\ /y/s/h/d
xcopy \\PSIDC1\PSI\data\Visio\*.* \\PSIBACKUP\psi\data\Visio\ /y/s/h/d
xcopy \\PSIDC1\PSI\data\CADFILES\*.* \\PSIBACKUP\psi\data\CADFILES\ /y/s/h/d
xcopy \\PSIDC1\PSI\\dataFAMS\*.* \\PSIBACKUP\psi\data\FAMS\ /y/s/h/d
xcopy \\PSIDC1\PeachTree\*.* \\PSIBACKUP\psi\data\pca\ /y/s/h/d
xcopy \\PSIDC1\PSI\msoffice\*.* \\PSIBACKUP\psi\msoffice\ /y/s/h/d
xcopy \\PSIDC1\Home\*.* \\PSIBACKUP\psi\home\ /y/s/h/d
xcopy \\PSIDC1\Pca_new\*.* \\PSIBACKUP\psi\data\pca_new\ /y/s/h/d
attrib -a \\PSIBACKUP\psi\*.* /s/d

Open in new window

Question by:submarinerssbn731
  • 4
  • 2
LVL 68

Accepted Solution

Qlemo earned 500 total points
ID: 39903535
Firstly, you should stop using XCopy and try to migrate to RoboCopy, which is part of the OS since XP now. It's much more robust against issues, and allows for better control.

When using XCopy you should add the /c switch to continue after errors. Otherwise XCopy stops as soon as it hits e.g. locked or protected files.

Author Comment

ID: 39903539
Thank you Expert but I am not sure what a "code block" is.

Author Closing Comment

ID: 39903566
Great answer!!!  I am working on the Robocopy script right now!!!  Thanks!!!
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.


Author Comment

ID: 39903640
I tried rerunning the xcopy routine and when it attempted to do the home directory I received a insufficient memory error.  What to I need to add to prevent this from happening?  Thanks
LVL 68

Expert Comment

ID: 39903865
Probably that is a result of circular links in the home directory, generating extensive long paths. I cannot think of a way to prevent from following those links. RoboCopy should not have that issue.

Author Comment

ID: 39904097
Thanks for the explanation!

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

I recently purchased an HP EliteBook 2540p notebook/laptop. It has two video ports on it – VGA and DisplayPort. HP offers an optional docking station for the 2540p that also has both a VGA port and a DisplayPort. There are numerous online reports do…
So many times I have seen the words written in a question "if only I could show you" or " I know how hard it is for you since you can't see it" in any zone. That has inspired me to write about this tool in windows 7 called "Problem Steps Recorder…
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

760 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

20 Experts available now in Live!

Get 1:1 Help Now