If you try to
cd to a network drive from the Windows CMD, you will get the following error:
CMD does not support UNC paths as current directories
cd command in CMD you can use a
pushd command, that creates a drive mapping to the network share and then changes into a path relative to the share it creates.
In PowerShell you should be able to
cd to a network drive without any errors as it natively supports UNC paths and the
In this small note i am showing how to
cd to a network drive from the Windows CMD and fix the error: “CMD does not support UNC paths as current directories“.
‘CD’ to Network Drive
Change a directory to a network drive in CMD:
C:\> pushd \\path\to\share
Change a directory to a network drive in PowerShell:
PS C:\> cd \\path\to\share
3 Replies to “[SOLVED] CMD does not support UNC paths as current directories”
Thank You, this was so helpful!
Ah, this answer helps me more than other online resources did. I just did pushd with the path and it mapped the path requested as the next available drive. If anyone reading this is really not getting the literal meaning of that, pushd does *not* cause the next available drive letter (descending from Z) to be mapped to the root of the path you entered. The *full* path is assigned to a drive letter. Thus, you cannot go “up” one folder on that drive, even if such a folder exists on that server.
Also, for naive scripters like myself, you must be aware of the sharing assignments on the UNC resource. The UNC resource must have the requested path shared to the user for it to be accessible by pushd. Even if the login account used to access the UNC resource is locally authorized to access all folders via direct login, those same folders must also be shared for remote access by pushd mapping.