Mapping a Network Drive Using net use

Mapping a network drive allows you to assign a local drive letter (like Z:) to a shared folder on another computer or server on your network. This enables easy access to shared resources such as project files, analysis reports, or configuration data.

Example Command

net use Z: \\Dept_BusinessLine\shared_docs

How It Works

Behind the Scenes

When you run the command:

net use Z: \\Dept_BusinessLine\shared_docs

This happens:

  1. Windows reaches out to the server Dept_BusinessLine over the SMB protocol (usually port 445).
  2. It checks that the folder shared_docs is shared and accessible.
  3. It assigns the shared folder to the drive letter Z: on your machine.
  4. Now you can access it like any local drive: via File Explorer or Z:\ in CMD/PowerShell.

Authentication

If the share requires credentials, you can specify them:

net use Z: \\Dept_BusinessLine\shared_docs /user:DOMAIN\username yourpassword

Persistent Mapping

To automatically reconnect this drive after restart:

net use Z: \\Dept_BusinessLine\shared_docs /persistent:yes

To remove it:

net use Z: /delete

Dummy Drive Examples

Here are some sample mappings you can try in a lab or demo environment:

net use Z: \\testserver\shared_docs
net use Y: \\fileserver\project_data
net use X: \\demo_machine\reports /user:DEMO\labuser labpass123
net use Q: \\192.168.1.50\public /persistent:yes
  

Use Cases

For questions or automation ideas, feel free to reach out.