C:\> cd \\somewhere
'\\somewhere'
CMD does not support UNC paths as current directories.

What I usually do to get around this is to map that directory to a network drive and then I could easily access it from the command prompt.

But is there an easier way on how to get around this?

link|improve this question

62% accept rate
2  
which windows do you use? If it's Windows 7, you've powershell preinstalled on your system. Powershell supports unc-paths and cmd-commands (with few exceptions). – wullxz May 13 '11 at 11:27
You can always browse to the unc path through run. – Kyle May 13 '11 at 11:45
@wullxz: cheers, I didn't know you could browse UNC paths with PowerShell. @kyle: That's actually a valid answer according to my question :) But I want to access it from a command line environment. Will modify my question to make this more clear. – Andreas Grech May 13 '11 at 12:09
If your problem is that you need to work just from the command line, you can map the network drive with the 'net' command: net use x: \\computer name\share name – Al Crowley May 13 '11 at 12:11
@Aleister Crowley: Yes I know, but I'm asking if there's an easier way that doesn't involve mapping a network drive. – Andreas Grech May 13 '11 at 12:12
show 1 more comment
feedback

3 Answers

If you're using XP you can have a look at this site http://support.microsoft.com/kb/156276

There is a registry value that you need to add, log out, log in again ... and now your cmd.exe does support UNC-Paths. It seems to me that you still can't cd to the path, but you can use it in other commands like dir, copy ...

An alternative might be using the pushd command, that will let you switch to the share (i guess by assigning it a temporary drive letter) http://support.microsoft.com/kb/317379

link|improve this answer
feedback

Kliu's "ContextConsole Shell Extension" (aka Open Command Prompt) says it, "can even open directories from network paths (UNC paths)" (from an Explorer window).

http://code.kliu.org/cmdopen/

enter image description here

link|improve this answer
1  
This program is most awesome! – afrazier May 13 '11 at 16:37
feedback

If you use pushd and popd instead of cd you won't get that UNC error.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.