1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

batch file backup?

Discussion in 'Windows XP' started by crabpa, Feb 18, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. crabpa

    crabpa Thread Starter

    Joined:
    Jan 30, 2003
    Messages:
    17
    In 98 I have a batch file that automatically runs when I click on it, to copy my documents folder out to the server.
    c:
    cd\
    cd\windows\command
    xcopy32 c:\mydocu~1\*.* y:\users\becky\mydocu~1\*.* /h/e/r/c/y
    cd\
    This won't run on a Windows 2000 machine. Any suggestions for changes I should make to make this work? Thanks!
     
  2. columbo

    columbo

    Joined:
    Sep 10, 2001
    Messages:
    3,178
    Hi,

    Try changing the "cd\windows\command" line to "cd\winnt\system32". Also, change the "xcopy32" to "xcopy".

    You'll likely also need to change the path to your documents. Instead of C:\My Documents, it will probably be C:\Documents and Settings\*Your profile's folder*

    So it might look more like this:

    C:
    CD\
    CD\WINNT\System32
    XCOPY C:\Docume~1\your profile's folder\*.* y:\users\becky\mydocu~1\*.* /h/e/r/c/y
    cd\

    You might want to confirm that the switches for XCOPY and XCOPY32 are the same (I'm assuming they are).

    Hope this helps.
     
  3. crabpa

    crabpa Thread Starter

    Joined:
    Jan 30, 2003
    Messages:
    17
    I'll try this...thanks!
     
  4. JohnWill

    JohnWill Retired Moderator

    Joined:
    Oct 19, 2002
    Messages:
    106,418
    There is no need to use the short 8 character file names, and if these directories get recreated or copied for any reason, they can change. This line:

    XCOPY C:\Docume~1\your profile's folder\*.* y:\users\becky\mydocu~1\*.* /h/e/r/c/y

    Should really be:

    XCOPY "C:\Documets and Settings\[your profile's folder]\*.*" "y:\users\becky\[full long file name]\*.*" /h/e/r/c/y

    There are also pretty slick programs to allow you to synchronize directorys across the network that will keep the copy identical to the current folder without copying files that are already there. They can also be configured to delete any orphan files on the destination. One that I really like is Beyond Compare, I have scripts to synchronize whole 120gig disks that use this program. :)
     
  5. crabpa

    crabpa Thread Starter

    Joined:
    Jan 30, 2003
    Messages:
    17
    Thanks johnwill, I went to their site and that looks like software we could use around here. :)
     
  6. Bob Cerelli

    Bob Cerelli

    Joined:
    Nov 2, 2002
    Messages:
    22,468
    You can also include the /d switch.

    This will only copy new or changed files. This way you don't keep backing up the same unchanged files. Speeds up the process quite a bit.
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/119513

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice