net use Z: \\Server01\Projects /user:CONTOSO\jsmith * Listing Current Connections To see all active network drives and connections:
net use The output will list drive letters, UNC paths, and status (OK, Disconnected, etc.).
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 : cmd command to map network drive
net use Z: \\Server01\Projects /user:DOMAIN\john.doe * Alternatively, provide the password in the command (less secure, see security section below):
:: Map department drives net use H: \Fileserver01\HomeFolders%username% net use S: \Fileserver01\Shared\Sales net use P: \PrintServer01\Scans (Y/N) . To suppress the prompt
echo All drives mapped successfully. pause
net use Z: "\\Server01\Project Files\Q1 Reports" You can explicitly specify the domain and even the domain controller: and status (OK
net use /persistent:yes If your server or share name contains spaces, enclose the entire UNC path in double quotes :