Announcement

Collapse
No announcement yet.

Batch Script to Backup HD from Windows XP

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch Script to Backup HD from Windows XP

    I was wondering I have Windows XP, does a Batch Script from Windows XP work. I have a External Hard Drive. I want to do a Backup of my Hard Drive, will the Batch Script
    cd c:\
    xcopy c: f:\backup /s /e /h /D


    in the NotePad.
    The F drive would be my external USB Hard Drive.
    I tried it and it doesn't work, does anyone know why it's not working. It just flashes and doesn't do nothing. I have somehow cagefile.sys after
    cd c:\
    xcopy c: f:\backup /s /e /h /D
    Not sure how that got in there?
    Can anyone help me, or know what i'm doing wrong.
    Last edited by MD777; 30th January 2008, 23:47.

  • #2
    Re: Batch Script to Backup HD from Windows XP

    Ok MD777,

    Few things for you to try.

    First, put all your switches in CAPS, for xcopy it may not matter, but I've come across programs with case sensitive command switches. Seeing as XCOPY show them all in CAPS in the help, i'd follow their convention.

    Second, try getting rid of /S... reason:
    "/S /E" from what i can see seems to have the same effect as /E by itself. And i don't think there is any point to over complicate things while your having problems. If you feel you must have that in, stick it in later once its working.

    Third idea, your going to run into problems when you try to copy files like "pagefile.sys" in theory this file should be locked all the time while windows is running and will give you an error message when you try to copy it. There are hundreds of files like this in your system drive. So to get around this i would add the switch "/C". In the event that xcopy reaches a file it doesn't have access to, rather than freaking out and stopping the process, it will skip and go to the next file.

    And sorry, but I'm out of idea's

    But a heads up, backing up the System drive with xcopy is fought with hazard. If you want to backup random bits of user created data through out the C Drive that you might have missed with a manual copy, then this will work fine, but you have plans of recovering all your windows settings and applications to a usable state. You'll get a horrible shock when your system fails and you want to use the xcopy to recover. For backing up the system state your going to need to look into something like "System Restore" - Provided with XP and up

    James

    P.S. good luck

    Comment


    • #3
      Re: Batch Script to Backup HD from Windows XP

      use xcopy c:\*.* ...
      ________
      Willys
      Last edited by DYasny; 6th March 2011, 18:02.
      Real stupidity always beats Artificial Intelligence (c) Terry Pratchett

      BA (BM), RHCE, MCSE, DCSE, Linux+, Network+

      Comment


      • #4
        Re: Batch Script to Backup HD from Windows XP

        Don't use this way for backups but use a backup software solution like ntbackup or use an imaging software solution like Ghost.

        If you're talking about some data folders I can recommend using robocopy.
        Way more powerful then xcopy.
        Marcel
        Technical Consultant
        Netherlands
        http://www.phetios.com
        http://blog.nessus.nl

        MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
        "No matter how secure, there is always the human factor."

        "Enjoy life today, tomorrow may never come."
        "If you're going through hell, keep going. ~Winston Churchill"

        Comment


        • #5
          Re: Batch Script to Backup HD from Windows XP

          I do use Ghost - Norton Ghost for my backup, but I thought a Batch file or Batch Script would work as good or better

          Comment


          • #6
            Re: Batch Script to Backup HD from Windows XP

            Well it won't work as good as Ghost when you're trying to backup the system.
            Marcel
            Technical Consultant
            Netherlands
            http://www.phetios.com
            http://blog.nessus.nl

            MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
            "No matter how secure, there is always the human factor."

            "Enjoy life today, tomorrow may never come."
            "If you're going through hell, keep going. ~Winston Churchill"

            Comment

            Working...
            X