Solved

Simple xcopy backup script

Posted on 2011-02-25
3
824 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
[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
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 49

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 82

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

623 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