Results 1 to 9 of 9

Thread: xcopy issue

  1. #1
    Member
    Join Date
    Jun 2001
    Posts
    323

    Question xcopy issue

    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
    Stark Raving MOD Midknyte's Avatar
    Join Date
    May 2002
    Location
    Arkham Asylum
    Posts
    22,270
    What happens when you manually try to copy the file from C: to Z:? If you can't do it that way, then xcopy won't work either.

  3. #3
    Member
    Join Date
    Jun 2001
    Posts
    323
    I was able to copy the file from C: to Z: so I know he can do that. But the command itself still gives me a access denied error message.

  4. #4
    Stark Raving MOD Midknyte's Avatar
    Join Date
    May 2002
    Location
    Arkham Asylum
    Posts
    22,270
    Are you trying to copy one file or the whole folder/subfolders? Try just * instead of *.*

    xcopy "C:\AACC DATABASE\*" "Z:\AACC\" /k /v /y /x /s /r

    If it's just for a single file, you could use copy instead of xcopy also.

    I was able to copy the file from C: to Z: so I know he can do that.
    So another user is trying this and getting "access denied"? Are you testing with his profile or another user that has the same permissions?

  5. #5
    Member
    Join Date
    Jun 2001
    Posts
    323
    I need to copy this file on a regular basis so the copy needs to be able to overwrite the existing file each time. Can you do that with just the copy command via a script? I was planning on creating a batch file to run a command every night to copy that file to the location and overwrite the existing file.

    I've always been logged in as the user who uses the PC all the time. I was not logged in as myself. When I said I know he can do it it's because I was at his PC with him logged in and I was able to copy the file as him.

  6. #6
    Stark Raving MOD Midknyte's Avatar
    Join Date
    May 2002
    Location
    Arkham Asylum
    Posts
    22,270
    just put a /Y after the copy command and it will overwrite.

    You might even want to cd into the source directory before you do the copy in batch. You may need to use the xxxxxx~1 instead of the full folder name.

  7. #7
    Administrator Steve R Jones's Avatar
    Join Date
    May 1999
    Location
    Largo, FL.
    Posts
    5,275
    Is the file in use when you try to copy it?

  8. #8
    Ultimate Member rraehal's Avatar
    Join Date
    Jan 2002
    Location
    Denver, Colorado, USA
    Posts
    3,874
    Did you check file permissions on both the source drive ( C: ) and the destination ( Z: ) - the command might be failing because it can not access a file on the C drive. I get that alot when I use USB hard drives on different networks because the SSID's for each network are different. I have to apply new security to and take ownership of files sometimes to fix the issue.
    -- Mathias

  9. #9
    Member
    Join Date
    Jun 2001
    Posts
    323
    [SOLVED]

    I used this command in a batch file and setup a scheduled task and it did the trick.

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

Posting Permissions

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