How to deal with CMD does not support UNC paths as current directories
Fri, 29 Aug 2014

"Invalid directory path, UNC paths are not supported"

The solution is to use pushd instead of cd to change the current directory to a share accessed via a UNC path (e.g.: > pushd \\192.168.1.1\sharepath).

The pushd command creates a temporary drive letter that points to the network share, and then changes the command prompt to that drive letter. 

You can use the pushd command several times in one session. This creates a list (or "stack") of folders. You can type pushdwith no path name to view the current state of the stack. 

Use popd when done.

How to Use the POPD Command

You can use the popd command to remove the top folder from the stack. The popd command returns you to the previous folder, and removes the temporary drive letter that was created by the pushd command. 

The pushd and popd commands work together. The pushd command captures the name of the current folder. You can also add the name of a folder to which you want to change. For example, typing pushd \share switches you to the share folder, but remembers the name of the current folder. To return to this folder, type popd

comments powered by Disqus