While the standard method to map a network drive is through File Explorer, using the Command Prompt (CMD) provides more control, speed, and automation possibilities for advanced users. 🚀 The Core Command: net use
Windows' built-in command for mapping network drives is net use.
cmdkey /add:server /user:domain\user /pass:securepass
net use Z: \\server\share
net use Z: \\server\share /user:admin P@ssw0rd # INSECURE
[drive letter] with the drive letter you want to assign (e.g., Z:).[server name] with the name or IP address of the server hosting the shared folder (e.g., \\fileserver).[shared folder] with the name of the shared folder (e.g., shared_docs).Kevin sat at his station, cracking his knuckles. "Alright," he said, reaching for the mouse. "I’ll just Remote Desktop into each one, go to 'This PC,' hit 'Map Network Drive,' browse for the share..."
| Action | Command |
|--------|---------|
| Map drive | net use Z: \\server\share |
| Persistent | net use Z: \\server\share /p:yes |
| With different user | net use Z: \\server\share /user:NAME * |
| Delete mapping | net use Z: /delete |
| List mappings | net use |
| Map without letter | net use \\server\share |