How do I change to a mapped network drive at the command line?
Solution 1
You need to make sure that the drive is mapped under the user which is running the command prompt. Try typing net use U:
and see what info it gives you. If it's not showing the drive as being mapped, try remapping the drive (net use U: \\servername\share\path\
).
You can also try changing directories by using cd /d U:
, rather than just U:
. This won't help you though if the network path doesn't exist.
Solution 2
CD if in the user account where drive is mapped.If you are in a Elevated Command you are no longer in the mapped user account.
Win 7: net use U: \servername\share\path\
win 8: pushd \servername\share\path\
Solution 3
In case you're using Windows 8 the pushd
command will help you
pushd u:
Source: How to cd to a network drive on Windows 8?
Related videos on Youtube
Nick Hodges
I'm a Delphi developer who is now really into Angular and I'm very interested in the Software Development process.
Updated on September 17, 2022Comments
-
Nick Hodges over 1 year
I have a networked drive mapped to "U:\"
I want to go to that drive from a command line.
However, when I try I get an error
C:>u: The system cannot find the drive specified.
How do I do that? Can I? Is there some Environmental setting I need to do?
-
Hack-R almost 7 yearsWeirdly I am on Windows 7 but it's pushd not net use. Maybe because of some update/patch?
-
wizlog almost 7 yearswhy was this downvoted?
-
user5359531 almost 5 yearsit is mapped but still not working when I use
cd
-
DeshDeep Singh over 4 yearsPerfect answer.! very easy to use shared drives now.