Mapping a network drive lets you assign a drive letter (like Z:) to a shared folder on another computer or NAS so you can access it like a local drive. In this post you'll learn how to map, disconnect, and troubleshoot network drives using the classic Windows Command Prompt (cmd.exe). I'll cover common options, practical examples, and tips for scripting and automation.
Don’t teach users to map manually. Deploy a CMD script via Group Policy:
User Configuration > Policies > Windows Settings > Scripts (Logon/Logoff) cmd map network drive better
Why Use CMD to Map Network Drives?
net use [DriveLetter:] \\Server\Share [Password | *] [/user:[Domain\]Username] [/persistent:yes] [/savecred] [/delete]
Command:
Pro Tip for System Admins:
If you want the drive to be visible to all users (including Admin accounts running as different users), you must create a specific registry value or use the GUI. CMD net use binds to the current user session context only. How to Map a Network Drive from the
New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\Server\Share" -Persist Why it's better: Command: Pro Tip for System Admins: If you