Windows – How to connect to a remote computer from Windows cmd.exe

cmd.exeremote accesswindows

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 192.168.1.109. 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@192.168.1.109\home
pushd \\192.168.1.109\home
pushd \\192.168.1.109\root\home
pushd \\root\192.168.1.109\home
pushd \\192.168.1.109@root\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?

Best Answer

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

net use * \\192.168.1.109\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 \\192.168.1.109\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
S:\home>

or

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

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?