Solved

Simple xcopy backup script

Posted on 2011-02-25
3
798 Views
Last Modified: 2012-05-11
Hi I have been trying to develop a batch file that will backup multiple directories of a users profile and work files.

I have a directory in the root of the drive named work and then I would like to copy outlook email pst files, my docs, desktop and favourites. I have seen may ways on various websites but my own scripts always fail! For instance;

I would like to backup via a external USB hard-drive with ther drive letter F:

I have tried
xcopy "%userprofile%\Desktop\"*.* F:\Backup\Desktop /s /c /d /e /h
pause

and nothing happens.

If I go to the command line Run - cmd

it shows c:\documents and settings\user:

if I manually point to F:\backup\Desktop\ from the cmd promt

it shows f:\backup\desktop:

I then try
xcopy "%userprofile%\Desktop\"*.*   /s /c /d /e /h
 it works!

Is there something fundemental that I'm missing? I have already created the destination folder "desktop" on the F: drive

Any ideas?

0
Comment
Question by:edgeit
3 Comments
 
LVL 21

Expert Comment

by:jvuz
ID: 34978352
Why do you use quotes: xcopy "%userprofile%\Desktop\"*.* F:\Backup\Desktop /s /c /d /e /h
0
 
LVL 47

Expert Comment

by:dbrunton
ID: 34982239
I have tried
xcopy "%userprofile%\Desktop\"*.* F:\Backup\Desktop /s /c /d /e /h
pause

and nothing happens.

What do you see on the screen when you execute your batch file?
0
 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 34991899
this works for me
xcopy "%userprofile%\Desktop\*" e:\temp  /c /m /s /d /e /h

I use the /m to only copy modified files (resets the archive bit)
0

Featured Post

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.

Join & Write a Comment

Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
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…

762 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

19 Experts available now in Live!

Get 1:1 Help Now