How to copy subdirectories and files from a mapped drive using robocopy

Juan De Leon Jr 0 Reputation points
2025-01-29T16:01:59.2+00:00

I am using robocopy in a Windows Server 2022 and I am trying to copy subdirectories and files from a mapped drive using the following:

robocopy z:\shares c:\shares /E /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE

when I execute the command I get the following error:

*Accessing Source Directory z:\shares*

The system cannot find the file specified.

If I change the source destination to *z:* -- it will copy everything.

I only need to copy the subdirectories and files from the "shares" folder. What switches should I use?

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,726 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Juan De Leon Jr 0 Reputation points
    2025-01-29T17:52:33.2633333+00:00

    I get "dir : Cannot find path" with those dir commands.

    However, I get a directory list when I do "dir Z:".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.