Solved

Simple xcopy backup script

Posted on 2011-02-25
3
814 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 48

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 81

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Disclosure: Use this tutorial only when no other options helps to get Windows XP running without any problems and you don't want to format the drive. The back up of the data is the responsible of the user, however there is a description of how t…
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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

738 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