Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: xcopy (Pro)

  1. #1
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    xcopy (Pro)

    I've been trying to create a batch file containing the xcopy command but I can't get it to work. I can get the copy command to work and xcopy will work inside the run box but not from inside a bat file. Is it possible and if so, how is it done?

    Thanks,

    Chris (Hunt)

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    There is some sample code to run a backup using xcopy here - does that help?

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    Thanks Leif, that's a useful and interesting article but unfortunately it doesn't help me. I tried very similar code to that mentioned and it doesn't do anything. For some reason xcopy will only work from the run box on my machine. It won't work from the command prompt. I get the following when I try it:

    'xcopy' is not recognized as an internal or external command, operable program or batch file.

    Any ideas?

    Chris

  4. #4
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    What happens if you enter
    help xcopy
    at the command prompt?
    Attached Images Attached Images
    • File Type: gif x.gif (11.9 KB, 0 views)

  5. #5
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    That's interesting. I get the same error message:

    'help' is not recognized as an internal or external command, operable program or batch file.

    I wonder if this problem is somehow connected to the missing gpedit.msc snap-in problem I'm having. Something is screwy.

    Chris

  6. #6
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    Can you run *any* DOS-type commands in the command prompt?
    DIR?

    Edited to add:

    . . . and maybe some interesting info here at zdnet : "DOS is Dead, Long Live the Command Line" . . .

  7. #7
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    Yes, I can use dir and even copy.

    Will check out your link.

    Thanks,

    Chris

  8. #8
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    While you are at it, have a look at xxcopy . . .

  9. #9
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: xcopy (Pro)

    This may be totally dumb, but is it possible that there could be a difference in how you run the command prompt - COMMAND as opposed to CMD?

    Edited to add: How about your PATH setting? Is it possibly not showing the Windows and System directories for some reason?

  10. #10
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    Hi Big Al, I think you may be on to something. I checked the path setting and it was pointed at L: the drive I use for storing temp folders. What should the path be? I changed it to c:windowssystem32 but command prompt still won't recognise the help command or xcopy.

    Thanks,

    Chris

  11. #11
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    <P ID="edit" class=small>(Edited by Leif on 03-Jan-03 12:39. )</P>Ignore this post - I just reread your earlier posts to see you've been there, done that...

    Just as a matter of interest, can you run
    help
    from the command prompt. It should list *all* the commands available to you....

  12. #12
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: xcopy (Pro)

    Let me see if I copied these correctly:

    %SystemRoot%system32;%SystemRoot%;%SystemRoot%Syst em32Wbem;C:Program FilesDiskeeper
    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

    I did this just in case there's more than one element screwed up in your environment variables. When I look at the above two lines inside the System app, the first is called PATH and the %systemroot% stuff shows up as C:WINDOWS

    That second line, when you're in there looking, is called PATHEXT. I made a screenshot just in case it would help. I have no idea how one would "rebuild" the environment variable if there's more corruption.
    Attached Images Attached Images

  13. #13
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    More reading for you, I'm afraid:
    Command-line reference A-Z
    and
    New ways to do familiar tasks which states "Windows XP retains and enhances almost all MS-DOS functionality."
    (Both from MS TechNet)

  14. #14
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    Genius, Big Al, pure Genius! I copied the settings you supplied and now my command prompt works as it should. Moreover you were right about the gpedit.msc problem - that had the same cause - two problems slain by the same stone. Thank you very much!

    Chris

  15. #15
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: xcopy (Pro)

    Thanks for the posts Leif. I think the same information is in the command line reference help files accessed by typing hh ntcmds.chm in the run box. I got that from the first article you linked me to. The command line reference is very useful and thanks to Big Al and you I now have a Bat file that works.

    All the best,

    Chris

Page 1 of 2 12 LastLast

Posting Permissions

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