Xcopy cannot create directory


  1. Posts : 22
    Windows Vista and 7
       #1

    Xcopy cannot create directory


    My backup cmd file has been in use since XP, through Vista to Win7. It has worked on a new laptop in Win7 ever since Win7 was released. Recently it has stopped working getting an access denied, cannot create directory message. It is xcopying my own folders, not the default documents etc.
    In a cmd prompt, xcopy d:\data z:\ fails with the error, but copy d:\data z:\ doesn't.
    Has MS patched xcopy recently? If so, how can I get back the earlier version?
      My Computer


  2. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #2

    Hi dougham,

    This sounds like a permissions issue. Please try this option:

    Code:
     
    xcopy d:\data z:\ /T /O
    /T = create directory structure
    /O = Copy file ownership and ACL information

    Let us know if it works for you.

    Regards,
    Golden
      My Computer


  3. Posts : 22
    Windows Vista and 7
    Thread Starter
       #3

    Hi Golden

    Using exactly as you suggest gives error "Access denied".

    The strange thing I find is COPY works but XCOPY doesn't!

    Cheers

    Dougham
      My Computer


  4. Posts : 1,814
    XP / Win7 x64 Pro
       #4

    Has your Z drive always been connected to your Win7 machine or have you recently connected your external Z drive to another machine?
      My Computer


  5. Posts : 22
    Windows Vista and 7
    Thread Starter
       #5

    The Z: drive is a network drive, not connected specifically to the Win7. My desktop and my wife's laptop all have a drive mapped to the NAS.
    Again I come back to why copy works but not xcopy.
      My Computer


  6. Posts : 1,814
    XP / Win7 x64 Pro
       #6

    And nothing has changed in your batch file between the times it worked and now that it doesn't?

    I would verify you still have the proper permissions on the drive in the NAS as well.
      My Computer


  7. Posts : 22
    Windows Vista and 7
    Thread Starter
       #7

    No the batch file hasn't changed.
    I am doing all the tests manually now
      My Computer


  8. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #8

    Mmm. OK, I wonder if its as simple as trying this:

    Code:
    xcopy d:\data\*.* z:\ /T /O /I /Y /E
    Note the *.* after d:\data\

    Regards,
    Golden
      My Computer


  9. Posts : 22
    Windows Vista and 7
    Thread Starter
       #9

    I've attached the output from another attempt. I copy OK, but can't xcopy.
    Attached Thumbnails Attached Thumbnails Xcopy cannot create directory-xcopy.jpg  
      My Computer


  10. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #10

    Hi,

    Can you confirm that you can run xcopy from your wife's PC to the NAS?

    Regards,
    Golden
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:15.
Find Us