Results 1 to 11 of 11

Thread: xcopy issue

  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Atlanta, Georgia, USA
    Posts
    276
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Hello all. I want to use xcopy to copy a file from within a folder on C: to a mapped drive Z:

    The file is a .mdb file and it's location is C:\AACC DATABASE\atlanta6.mdb. The location where I want the copy to go is identical except for the drive letter which is Z:

    The folder is already on the Z: drive so just the file needs to be copied. What's happening is I'm getting an "access denied" error message. Here's the command I'm using:

    C:\Documents and Settings\squjam>xcopy "C:\AACC DATABASE\*.*" "Z:\AACC\" /k /v /y /x /s /r

    One or more of those switches may be redundant or unnecessary as I began just trying one switch after another to resolve issues as they arose. Now I'm stuck at the current error, "access denied". I've checked the permissions on the file and the folder and all looks well there. The AACC DATABASE folder on the C: drive is shared and I looked at the permissions for the share as well; again everything looks fine.

    Any ideas and help would be great.

  2. #2
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    [quote name='telecomguy9' post='796797' date='07-Oct-2009 17:17'][/quote]
    A few comments:
    /S means also copy subdirectories, which doesn't seem to be what you want! Try /U.
    If you are copying a single file, why the *.*?
    Check if you can double-click on the source and the target folder name and file(s) using My Computer or Windows Explorer without getting the error message.
    There's no other program accessing the source (or target) file when you're running your XCOPY?
    BATcher

    Time prevents everything happening all at once...

  3. #3
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Atlanta, Georgia, USA
    Posts
    276
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the info and ideas. The file isn't open and I did just successfully copy it to the Z: drive location. Now that I have a copy there I'd like to create a xcopy command that will overwrite the existing file with the one from the C: drive.

  4. #4
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    [quote name='telecomguy9' post='796806' date='07-Oct-2009 18:06']Thanks for the info and ideas. The file isn't open and I did just successfully copy it to the Z: drive location. Now that I have a copy there I'd like to create a xcopy command that will overwrite the existing file with the one from the C: drive.[/quote]
    The switches I would use are: /K /O /Y YSMV!
    (but then again, I would probably use ROBOCOPY, because I always do...)
    BATcher

    Time prevents everything happening all at once...

  5. #5
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Atlanta, Georgia, USA
    Posts
    276
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is it possible to use robocopy in a script that's a simple batch file? I'll use it if it would make this work. 8)

  6. #6
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    [quote name='telecomguy9' post='796834' date='07-Oct-2009 20:58']Is it possible to use robocopy in a script that's a simple batch file? I'll use it if it would make this work. 8)[/quote]
    I use it all the time in BATch files! But for what you are doing, even COPY should work...
    BATcher

    Time prevents everything happening all at once...

  7. #7
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Atlanta, Georgia, USA
    Posts
    276
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I want to copy a file from one drive to another and the file already exists what command line or string would I use so that the overwrite is automatic and done with question? Since I want this to run automatically in the middle of the night when no one is around I need it to just go and ignore the fact that no one is issuing the command while sitting in front of the computer.

  8. #8
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    [quote name='telecomguy9' post='796918' date='08-Oct-2009 13:42']If I want to copy a file from one drive to another and the file already exists what command line or string would I use so that the overwrite is automatic and done with question? Since I want this to run automatically in the middle of the night when no one is around I need it to just go and ignore the fact that no one is issuing the command while sitting in front of the computer.[/quote]
    Just do

    COPY /Y "C:\AACC DATABASE\atlanta6.mdb" "Z:\AACC\"

    but test!
    BATcher

    Time prevents everything happening all at once...

  9. #9
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Atlanta, Georgia, USA
    Posts
    276
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'll test and get back to you. Thanks.

  10. #10
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Atlanta, Georgia, USA
    Posts
    276
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That worked perfectly! Thank you very much.

  11. #11
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    [quote name='telecomguy9' post='797103' date='09-Oct-2009 14:44']That worked perfectly! Thank you very much.[/quote]
    Yey!
    BATcher

    Time prevents everything happening all at once...

Posting Permissions

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