Map Network Drive Windows 11 Command Line Exclusive Jun 2026
If the network share requires a different username and password than your Windows login, add the user switch:
While not cmd , PowerShell is useful in modern scripts:
If you don’t care which letter is used and just want the next one available, use an asterisk: net use * \\ServerName\SharedFolder Use code with caution. Method 2: Using PowerShell ( New-PSDrive ) map network drive windows 11 command line
The letter you want to assign (don’t include the colon here).
Ensure "Network Discovery" and "File and Printer Sharing" are turned on in the Windows 11 Settings. If the network share requires a different username
To avoid storing the password in plain text, use * to prompt interactively:
By default, mapped drives using net use are – they disappear after you log off. To make the drive reconnect automatically every time you sign in, use the /persistent:yes flag. To avoid storing the password in plain text,
| Command | Description | |---------|-------------| | net use Z: \\server\share | Map drive Z to share | | net use Z: \\server\share /persistent:yes | Persistent mapping | | net use Z: \\server\share /user:name * | Map with password prompt | | net use * \\server\share | Auto-assign drive letter | | net use Z: /delete | Remove mapping | | net use | List current connections | | net use /persistent:yes | Make all future maps persistent |
Mapping a network drive via the Command Prompt (CMD) or PowerShell is a power-user move that saves time, especially when managing multiple workstations or automating setups with scripts.
net use \\server\share /persistent:yes
She cracked her knuckles. "Let’s map a drive."
