Take the 2-minute tour ×

I am trying to connect to a remote computer from Windows cmd.exe. At first I was trying to cd to it, but then I discovered pushd. Now I am trying pushd to it with a UNC path, and the hostname is root, the ip address is My problem is I don't know how to specify the hostname in the UNC, because I can't find examples on that anywhere. I have tried

pushd \\root@\home
pushd \\\home
pushd \\\root\home
pushd \\root\\home
pushd \\\home

The first gives me "The system cannot find the path specified.", and the rest give me, "The network path was not found."

If only I could find clear examples of how to include a hostname (in this case "root") in a remote UNC path, or is there something else wrong here?

share|improve this question

migrated from stackoverflow.com Dec 13 '12 at 22:13

This question came from our site for professional and enthusiast programmers.

You're going from Windows, but to what system? Is it a Linux box? You may need to install some sort of ssh program on your Windows box. Otherwise, use net use share to connect the remote share to your computer. You can even use a drive letter. –  David W. Dec 13 '12 at 22:04

2 Answers 2

If you want to establish remote connection to the box using RDP , run

mstsc /v:<servername:port>

If you want to connect to network share on the remote computer, use this:

net use * \\servername\sharename

You might need to have permissions for the share 'sharename', unless it is shared as public.

share|improve this answer

I’m 99.44% sure that you cannot either cd or pushd to a UNC path.

net use * \\\home

(the syntax identified in Ilya’s answer with your values substituted) will map the folder on the remote computer to an artificial disk drive device on your system.  The device will have a one-letter name, and the command will tell you what it is:

Drive Z: is now connected to \\\home

If you have a favorite letter that you want to use and that you know is not assigned to anything else, you can specifiy it as follows:

net use S: \\root\home

Note that you can simply put the hostname in the place of the IP address.

At least, you can do all of this if the remote computer is also running Windows.  If it isn’t, it still might work, but I’m not sure.

Do you know how to navigate a Windows system with multiple disk (pseudo-)devices?  Most people move between disks in two steps:

C:\> S:                              // Note: type just the drive letter and colon.
S:\> cd \home


C:\> cd S:\home              // Note: this doesn’t actually put you into S:\home.
C:\> S:                              // Now you’re there.

but there is a slightly shorter way:

C:\> cd /d S:\home          // cd/d means change directory and drive in one step.
S:\home>                              // Ta da!

Wait a minute … why did you tag your question ?  What OS is your local computer running?

share|improve this answer

Your Answer

