Map a Network Drive using Windows Vista or Windows Server 2008
Jul 21st, 2008 by MrGroove

Mapping a Network Drive using Windows Vista or Windows Server 2008 is easy right? Well, based on the number of emails I get asking me how it’s done, apparently it’s not as easy as Microsoft probably intended… Anyway, it’s really simple once I show you where it’s hidden so as an added bonus, I’ll also show you how to do it from the CMD line.
First, here’s the more common method using Windows Explorer.
How-To Map a Network Drive in Vista and Windows Server 2008 using Windows Explorer
1. Click Windows Start Button, Computer
2. Click Map network drive (I know…. It was hidden
3. Select the Drive Letter (I choose Z in my example), Type or Browse to the Server Share, Check Reconnect at Logon Box if you want the Mapping to be persistent (remain after a reboot). Click Finished when finished.
ALL DONE! I told you it was easy!
Ok, now let’s review the how-to from the CMD line interface.
How-To Map a Network Drive in Vista and Windows Server 2008 using the CMD Line
1. Click Windows Start Button and Type CMD then Press Enter Key

2. Type net use z: /persistent:yes \\servername\share and Press Enter
From the example above, feel free to use the drive letter of your choice. Use an * to choose the next available drive letter currently not mapped to anything.
You can also exclude the /persistent switch if you don’t want the mapping to be permanent (Persistent after a reboot). Additionally, you can use the IP address of the server/workstation if you want.
One other note, the above command string also assumes you have access to the server share your trying to access. If you need to connect using a different account, use the following command:
net use z: /persistent:yes \\servername\share /u:domain\account password
Confused? More questions? LOVE groovyPost.com? Leave a comment or post your question in the forum.
Tags: cmd, windows server 2008, windows vista

great tip. I found the windows explorer on my own but the CMD line section was nice. Didn’t know about the persistent switch!
Thanks again. Prior to reading this, I had resorted to mapping my drives from the command shell. Thanks again!
On a seperate thread….. how did you turn your text yellow in the command shell window?
Thanks for this post. I have an XP box that I am trying to Map a drive to Windows 2008 server that I need to automatically connect each time the XP user logs on. While I have been able to establish a mapped drive to the domain from the XP box using the standard XP interface to set it up, each time I log off and then back on, the drive is not available. Yes the domain name and user name is filled in, but the drive will not connect until I provide the password. This is no doubt a Windows 2008 security setting issue.
So how do I get past the password issue on my mapped drive on an XP box that is connecting to Windows 2008 Server?
Thanks.
@Tomb - Hi Tom. Changing the colors of the CMD window is actually really simple. Rather than go into the Step-by-step here, I’ll write up a quick HOW-TO and link to it from here.
-MrGroove
@Craig - If you want a persistent drive mapping, it actually doesn’t have anything to do with the Windows Server. It all depends on how you map the drive. From the Windows GUI, be sure you check the box (Reconnect at Logon).
Also, alternatively if you map the drive from a CMD window (Command Prompt) you can use persistent:yes command as shown above in the Article.
net use z: /persistent:yes \\servername\share
Hope that fixes it for you.
Thanks for the response. I had previously done as you suggested using the (Reconnect at Logon). However when I open the control panel and attempt to look at the mapped drive, the windows logon screen comes back. This screen shows the previously defined domain and user name, but requires a pw. If I put the pw in for the displayed domain and user name, the share reappears.
The thing I probably forgot to indicate is the XP IS LOGGING ON LOCALLY. I know this is probably a “big forgot to tell you” this item.
Ah. Well, I actually don’t have an XP box that’s not domain attached so I cant test this but, what I would try next is:
Check the box, “Reconnect at logon”. Then, under that box Click the Text: “Connect using a different User name”. Enter in the credentials and PW and hopefully that does the trick.
If not, then try this LAST DITCH EFFORT. Go into Control panel, User Accounts, Advanced Tab, Manage Passwords. Click Add and enter in the Server and User & PW. This should use these credentials anytime you connect to resources from that server.
Let me know
-MrGroove
MrGroove: Unfortunately, I had already tried what you suggested in the first part, namely “Reconnect at Logon” and the Connect using a different user along with the correct username & pw. It almost got me there except the next time I logged on, the mapped drive still failed - retained the correct domain name and user but still promted for a pw.
I did not try the second half of your suggestion (the last ditch effort) but I did use your command line example along with another thread I found that works all of the time. The link on the how to is http://www.windowsnetworking.com/articles_tutorials/wxpplogs.html
Since this approach activates on each logon, I did not need to use your persistent option, but did of course need to use your user name and pw command line example.
My little batch file used in conjunction with the above referenced tutorial consists of one line:
net use P: \\MACHINENAME\FOLDERNAME\SUBFOLDERNAME /user:DOMAINNAME\username pw
The process described in the tutorial along with this batch/script file creates a P: drive on the Windows 2008 server whenever the XP box has a user who is setup to run the script. The XP box does not logon to the actual domain. The shared script folder doesn’t even have to reside on the C drive, so there must be something special about the “netlogon” share name within the Windows environment that I don’t grasp. But it does work each and every time.
Your Last Ditch Effort also seems logical. That’s the joy of Windows - only 30 million different ways to accomplish a task.
Thanks for the examples on how to get things done via the command line.
Yes… Net Use hasn’t really changed much over the years, but what about using a DFS namespace as the share instead of the server name. Currently we have scripts that use Net Use on W2K3 boxes that map drives to a \\domain\data\share\, but I can’t seem to get that to work on a W2K8 box.
Anyone got an idea?