Cmd Command To Map Network Drive Site

net use [devicename | *] [\\computername\sharename[\volume] [password | *]] [/user:[domainname\]username] [/persistent:yes ] Let's break down the key parameters:

net use Z: \\Server01\Projects /user:DOMAIN\john.doe * Alternatively, provide the password in the command (less secure, see security section below): cmd command to map network drive

net use * /delete You will be prompted: You have these remote connections: ... Continue with operation? (Y/N) . To suppress the prompt, pipe Y or use echo : To suppress the prompt, pipe Y or use

echo All drives mapped successfully. pause You will be prompted for the password: $cred

:: Map department drives net use H: \Fileserver01\HomeFolders%username% net use S: \Fileserver01\Shared\Sales net use P: \PrintServer01\Scans

net use \\Server01\Projects The share will appear under "Network locations" in File Explorer, but not as a drive letter. If your current Windows login doesn't have access to the share, specify another account. You will be prompted for the password:

$cred = Get-Credential New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\Server01\Projects" -Credential $cred -Persist Mapping network drives via the command line using net use is a powerful, flexible, and reliable method that every Windows professional should master. From quick one-off mappings to complex automated login scripts, the command line gives you control that the GUI simply cannot match.