Accessing a Windows Share from the Native Windows Command Prompt

I needed to run a application installer from a share located on a server. I knew I could use “net use” to map the drive but I remembered that there was an easier way but couldn’t recall the command. After some searching I found it:

pushd \\<server>\<share>

Then after you are done accessing the share:


Per the docs, pushd will start at the drive letter “Z” and work its way back until the next unused drive letter is found and use that letter for the mapping.

As a “net use” refresher to map a drive:

net use z: \\<server>\<share>

Of course there are other switches available so to get help:

net use /?

And since “net use” is part of the “net” command:

net /?