I'm trying to access files on another machine on the same network, I know you can do it with Windows Explorer by typing \computername\c$ etc. but when I do it in the command prompt it shows an error message (cmd does not support UNC paths as its current directories). Is there a way to bypass this? or do I have to always open explorer when I need to do it?
2 Answers
net use z: \\computername\share\
cd z:\
where z: refers to an unused drive letter on your local system.
The first line will map a network drive to the share and call it z:\ . The second line will CD you to the mapped location.
If the prompt doesn't change to z:\> after issuing both commands, simply type z:\ and hit enter. the Prompt should change. This is the result of old DOS functionality. If you use powershell, this last command won't be necessary.
to remove the mapped drive, either reboot, remove it via windows explorer, or run this command:
net use z: /DELETE
- 37,476
To open unc path of another machine from command prompt,
you can make use of pushd command
The syntax for the pushd command is
pushd unc path
Please open the command prompt and then execute the above command,Once you have executed then it will temporarily mapped and you can list the directory in the drive by using the following command
dir
- 6,378