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)
- Press Win + S, type
cmd, and launch Command Prompt. - Run the following command syntax to map a drive persistently:
net use Z: \\ServerName\ShareName /persistent:yes- Replace
Z:with your desired drive letter. - Replace
\\ServerName\ShareNamewith the actual UNC path to your network folder. - The
/persistent:yesswitch ensures the drive reconnects automatically upon system restart.
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:yesTo 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:yesUsing 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-Name "Z"specifies the drive letter without a colon.-Persistmakes the drive permanent across Windows sessions and visible in File Explorer.
If credentials are required in PowerShell:
New-PSDrive -Name "Z" -PSProvider "FileSystem" -Root "\\ServerName\ShareName" -Persist -Credential (Get-Credential)Verifying and Managing the Connection
View Active Mappings: Type
net useand press Enter to display all currently mapped network drives and their persistence status.Disconnect a Mapped Drive: To remove the mapped network drive, run:
net use Z: /delete