Commands · Command

CommandWindows

net use

net use [drive:] \\server\share [/user:username] [password]

Maps a network share to a local drive letter, or lists/removes existing mapped drives.

// FLAGS

/deleteremove an existing mapped drive
/persistent:yesreconnect the mapping automatically at every logon
/userspecify credentials for the connection

// EXAMPLE

net use Z: \\fileserver\shared /persistent:yes — maps the shared folder to drive Z: and keeps it reconnected across reboots.

// GOTCHA

A mapped drive created under one user account isn't visible to other users on the same machine (including an elevated/admin session) — a very common "the drive disappeared" ticket when someone runs a script as Administrator.

// RELATED COMMANDS