I am attempting to change directories to a file server such as:
cd \\someServer\\someStuff\
However, I get the following error:
CMD does not support UNC paths as current directories
What are my options to navigate to that directory?
I am attempting to change directories to a file server such as:
cd \\someServer\\someStuff\
However, I get the following error:
CMD does not support UNC paths as current directories
What are my options to navigate to that directory?
If you're considering scripting it, it's always helpful to learn about the
pushd
andpopd
commands. Sometimes you can't be sure what drives letters are already used on the machine that the script will run on and you simply need to take the next available drive letter. Sincenet use
will require you to specify the drive, you can simply usepushd \\server\folder
and thenpopd
when you're finished.Or you could switch your shell to PowerShell. It has complete support for UNC paths.
You could use
net use
to map a network drive to a UNC path and then browse to the mapped drive.This worked for me in Win8x64:
You should be able to do this in HKCU as well, just make sure you log off and back on again.
Slightly longer explanation of pushd here: http://shortfastcode.blogspot.com/2010/05/how-to-deal-with-cmd-does-not-support.html
Pushd Works, but ...
I have been using
at the start of cmd files for longer than I can remember, always with a complementary
at the end of the file. Until recently this was working, when:
Then I got the vague error, if not completely misleading error:
Finally, I thought to try
NET USE
To my surprise, I had used all of the drive letters up. After I did
I was happy again knowing I had not lost my mind.
Here is my standard cmd prolog:
As well as explicitly mapping a drive so that
cmd
can cope, which might be needed by other utilities too, you could also try an alternative command shell like PowerShell.as per @pk use pushd & popd, here is an example.
use pushd to create a temporary virtual drive and after done do a popd to delete the temporary virtual drive
Instead of
use
Below code completely worked for me, see the example
Wouldn't the junction command work here?