How do I change to a mapped network drive at the command line?

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?


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\