We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Copying a folder from drive d: to drive h: using Dos

Options
st999
st999 Posts: 1,574 Forumite
Part of the Furniture 1,000 Posts Name Dropper
I have a folder on an external drive that I want to copy to another external drive and Windows 10 throws a wobbly and complains that some of the files need admin permission or trusted and doesn't copy them.

I tried copying using dos but some files copy then it stops at the same files probably because the syntax of my command is wrong.

The name of the folder will be called CannotCopy and I want it to copy from USB drive d: to USB drive h: and be called Copied.

what exactly do I type in at the command prompt to make that happen?

I can use a Windows 10 laptop.
«1

Comments

  • Meepster
    Meepster Posts: 5,955 Forumite
    xcopy d:\cannotcopy h:\copied /O /X /E /H /K
    If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family anatidae on our hands

  • onomatopoeia99
    onomatopoeia99 Posts: 7,156 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    If you need admin rights to copy in "Windows" you will need them in a command prompt as well. It's not a matter of changing the syntax of the command.

    It's better to tackle problems by telling us the exact problem, with the exact error message and the file name(s) it occurs on. You may be able to achieve the copy using an elevated command prompt, but it depends on the error.
    Proud member of the wokerati, though I don't eat tofu.Home is where my books are.Solar PV 5.2kWp system, SE facing, >1% shading, installed March 2019.Mortgage free July 2023
  • st999
    st999 Posts: 1,574 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    I tried that and it stopped before all the files were copied with

    The system cannot find the path specified.
  • kwikbreaks
    kwikbreaks Posts: 9,187 Forumite
    From https://answers.microsoft.com/en-us/windows/forum/windows_10-security-winpc/cannot-zip-a-folder-access-denied-windows-10/cf6a3c7c-65e4-4ec3-970e-d0526e86637a

    (I found this when I looked up what would happen if trying to zip such a folder)
    We understand you are unable to zip a folder, we'll certainly assist you with this.

    Please share this information to assist you better.

    Have you made any recent changes prior to this issue?
    Which build is currently installed in your computer?
    The various reasons why you get an access denied error are:

    a: You may not have ownership of a file or folder.

    b: You may not have the proper permissions.
    c: The file or folder may be Encrypted.

    Refer to the below methods and check if it helps.

    Method 1:

    1. Right-click the file or folder, and then click Properties.

    2. Click the Security tab, and then click Edit.

    3. Do one of the following:

    4. To set permissions for a user that is not listed under Group or user names. Click on Add and type Everyone and click on OK. Give full permissions to the folder. Then click on OK.Then try to zip to a compressed folder.

    Method 2: I suggest you to perform the system maintenance troubleshooter. It will resolve the common system problems.
    1. Tap on Windows Key and click on search bar.
    2. Type !!!8220;Troubleshooting!!!8221; without the quotes and click on Troubleshooting.
    3. Then click on System and Security.
    4. Click on System Maintenance.
    5. Click on Next and follow the prompts to run the troubleshooter.
  • st999
    st999 Posts: 1,574 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    non of the files are zipped.
  • John_Gray
    John_Gray Posts: 5,843 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    A possible reason is that the file and/or folder names include blank(s).

    Try adding double-quotes to the 'from' and 'to' fields.

    Example (from above):
    xcopy "d:\cannot copy these" "h:\copied works" /O /X /E /H /K
  • AndyPix
    AndyPix Posts: 4,847 Forumite
    Fifth Anniversary 1,000 Posts Name Dropper Photogenic
    use windows explorer to browse to to location containing "cannot copy"


    RIGHT click on "cannot copy" and go to properties.
    Click the security tab
    Click the Advanced box


    Where it says "owner ...." click on "change"
    give it the username you are logged on with and verify it by clicking check names
    Put a tick in the box that says "replace owner on subcontainers etc"
    Click OK


    The system will then give you owner status over all files and folders within.


    Try the copy again, ensuring you have write access to the destination
  • stragglebod
    stragglebod Posts: 1,324 Forumite
    1,000 Posts Second Anniversary Name Dropper
    Were any of the files created in e.g. Linux? If the filenames have non standard characters in them that might cause problems.

    See if you can copy them using a Linux live CD.
  • kwikbreaks
    kwikbreaks Posts: 9,187 Forumite
    st999 wrote: »
    non of the files are zipped.
    I'm aware of that. I wondered if it would be possible to zip the folder and move the zip. It wouldn't because you can't zip the files because you don't have the relevant permissions. Take a look at the suggested solution in Method 1 to fix that. Once the permissions are fixed you should be able to do the copy. I see Andypix has also suggested that.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 350.8K Banking & Borrowing
  • 253K Reduce Debt & Boost Income
  • 453.5K Spending & Discounts
  • 243.8K Work, Benefits & Business
  • 598.6K Mortgages, Homes & Bills
  • 176.8K Life & Family
  • 257K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.