Map Network Drive Persistently in Windows 11 CMD

Mapping a shared network folder to a persistent drive letter ensures your system automatically reconnects to the network resource every time Windows 11 reboots. This guide provides the exact command-line instructions using both Command Prompt (net use) and PowerShell (New-PSDrive) to establish a persistent network drive connection quickly and reliably.

Using Command Prompt (net use)

  1. Press Win + S, type cmd, and launch Command Prompt.
  2. Run the following command syntax to map a drive persistently:
net use Z: \\ServerName\ShareName /persistent:yes

Mapping with Authentication

If the network share requires specific credentials, append the username and password parameters:

net use Z: \\ServerName\ShareName /user:Domain\Username Password /persistent:yes

To prevent your password from appearing in plain text or command history, use an asterisk * to be prompted securely:

net use Z: \\ServerName\ShareName /user:Domain\Username * /persistent:yes

Using PowerShell (New-PSDrive)

If you prefer using PowerShell, execute the following command to create a persistent drive mapping:

New-PSDrive -Name "Z" -PSProvider "FileSystem" -Root "\\ServerName\ShareName" -Persist

If credentials are required in PowerShell:

New-PSDrive -Name "Z" -PSProvider "FileSystem" -Root "\\ServerName\ShareName" -Persist -Credential (Get-Credential)

Verifying and Managing the Connection