Results 1 to 11 of 11

Thread: xcopy (MS-DOS)

  1. #1
    Senior Member Futterman's Avatar
    Join Date
    Apr 2005
    Location
    Rego Park/Forest Hills, NY
    Posts
    877

    xcopy (MS-DOS)

    Trying to set up the computers at work to automatically backup onto an external hard drive with a batch file called xcopy...

    I want it to copy only the "My Documents" folder on the C drive and place it in the "Port 2" folder on the F drive. I have the following line of code saved as "backup.bat" on the desktop (is this a good place to save it?):

    xcopy C:\Documents and Settings\user\My Documents F:\Port 2 /E /Y /M

    However, when I go to start it up, it opens and closes so fast I can't see what it says (obviously some sort of error message). What's happening?

    Few things to note:
    -The computer is networked
    -The F drive is shared on the network
    -OS is Windows 2000

    Does anyone know how to get this to work? Hopefully one of the Mikes or Eric are familiar with this program...

    Thanks,
    Brian
    "My wife is an air traffic controller. I married her because I've always wanted to screw the FAA." - B. Wulle

  2. #2
    Administrator PhilDernerJr's Avatar
    Join Date
    Apr 2005
    Location
    Queens, NY
    Posts
    12,470
    I'd take a stab at taking a screen shot of that error message.
    Email me anytime at [email protected].

  3. #3
    Senior Member Futterman's Avatar
    Join Date
    Apr 2005
    Location
    Rego Park/Forest Hills, NY
    Posts
    877
    Okay, not exactly an error message, but it's up for literally a quarter of a second.




    Brian
    "My wife is an air traffic controller. I married her because I've always wanted to screw the FAA." - B. Wulle

  4. #4
    Senior Member
    Join Date
    Apr 2005
    Location
    Rockaway Beach, NY
    Posts
    451

    Re: xcopy (MS-DOS)

    Quote Originally Posted by Futterman
    xcopy C:\Documents and Settings\user\My Documents F:\Port 2 /E /Y /M
    If you are coping all files in the My Documents folder add a "\*.*" (no quotes) after the My Documents. And same after the Port 2. Shoud look like this:

    "xcopy C:\Documents and Settings\user\My Documents\*.* F:\Port 2\*.* /E /Y /M

    I'm not real familair with the switches but you could add \S to include subedirectories (e does that too but copies even if empty, \H for hidden files and you might consider \D to check time stamps to see if the file needs to be copied.

    Mike

  5. #5
    Administrator
    Join Date
    Apr 2005
    Location
    Pennsylvania
    Posts
    57

    Re: xcopy (MS-DOS)

    Quote Originally Posted by Futterman
    xcopy C:\Documents and Settings\user\My Documents F:\Port 2 /E /Y /M
    The problem is occuring because of the spaces in the directory names. (In response to Mike's post, you shouldn't need to include *.*, as that's implied by using xcopy.) You would need to include the directories in quotation marks, such as:

    xcopy "C:\Documents and Settings\user\My Documents" "F:\Port 2" /E /Y /M

    However, you may want to look for a free backup solution that runs as a Windows application, so you could run it in the background or do scheduling (though it is possible to schedule DOS commands, that's more trouble than it's worth). You could probably find a freeware one at http://www.download.com.

    Hope this helps.

  6. #6
    Senior Member
    Join Date
    Apr 2005
    Location
    Rockaway Beach, NY
    Posts
    451
    Ah, good catch Mike. I left out the need for the " as I always add them. That certainly was the problem, an important omission on my part. I've always used *.* as a habit, guess it's not really needed.

    Mike

  7. #7
    Administrator
    Join Date
    Apr 2005
    Location
    Pennsylvania
    Posts
    57
    It's cool. :) DOS is way too picky. :-P

  8. #8
    Senior Member moose135's Avatar
    Join Date
    Apr 2005
    Location
    Long Island, NY
    Posts
    8,067
    Quote Originally Posted by Mike
    It's cool. :) DOS is way too picky. :-P
    Kids these days. I remember back before Windows, when we were glad to have DOS. :P

    I'm going to take my abacus and go home now.

  9. #9
    Administrator
    Join Date
    Apr 2005
    Location
    Pennsylvania
    Posts
    57
    *laughs* My first computer was a 286. 'nuff said. ;)

  10. #10
    Senior Member moose135's Avatar
    Join Date
    Apr 2005
    Location
    Long Island, NY
    Posts
    8,067
    Quote Originally Posted by Mike
    *laughs* My first computer was a 286. 'nuff said. ;)
    I remember my first one of those - I started on an IBM "XT", even before the x86 days. It even had a color monitor - black with yellow/orange glowing text.

    Yes, I know, I'm an old fart. Of course, getting old beats the alternative. :)

  11. #11
    Administrator
    Join Date
    Apr 2005
    Location
    Pennsylvania
    Posts
    57
    Woah, lol.

    True. ;)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •