Skip to content

Access UNC paths from the Windows command line

I am, with surprising regularity, faced with the need to access UNC paths from the command line, as that is perhaps pretty much the quickest way to browse to network shares with a different user than the one currently logged in. There’s just one issue: the Windows command line does not support UNC paths from the cd/chdir command. There is, however, a way to work around this issue; by creating a temporary virtual drive. 

The command line being what it is, there is of course, a command for this; pushd. If mapping to \\host\path, the command would be pushd \\host\path. In order to remove the mapping, you used the command popd. Many thanks to user Andreas Grech for leading me to the answer.

By posting a comment, you consent to our collecting the information you enter. See privacy policy for more information.

This site uses Akismet to reduce spam. Learn how your comment data is processed.