:: Map project drive with specific credentials net use Z: \ProjectServer\CurrentProjects /user:CONTOSO\projectuser *
net use Z: \\Server01\Projects /user:DOMAIN\john.doe P@ssw0rd123 Persistent vs. Temporary Mappings By default, mapped drives are persistent —they reconnect automatically after you log off and back on. To create a temporary mapping that disappears when you log off, use:
net use [devicename | *] [\\computername\sharename[\volume] [password | *]] [/user:[domainname\]username] [/persistent:yes ] Let's break down the key parameters: cmd command to map network drive
net use Z: \\Server01\Projects If the command succeeds, you will see: The command completed successfully. You can now open Z: in File Explorer. Sometimes you only need to access a share without cluttering your drive list. You can create a connection without a letter:
:: Map department drives net use H: \Fileserver01\HomeFolders%username% net use S: \Fileserver01\Shared\Sales net use P: \PrintServer01\Scans :: Map project drive with specific credentials net
net use The output will list drive letters, UNC paths, and status (OK, Disconnected, etc.).
New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\Server01\Projects" -Persist The -Persist switch is equivalent to /persistent:yes in CMD. PowerShell also allows mapping using different credentials: You can now open Z: in File Explorer
In the modern IT environment, network drives remain the backbone of data sharing and centralized storage management. While the graphical user interface (GUI) of Windows—using "Map network drive" in File Explorer—is convenient for the average user, the command line offers unparalleled speed, automation, and troubleshooting capabilities. Whether you are a system administrator managing hundreds of workstations or a power user looking to optimize your workflow, mastering the net use command in Command Prompt (CMD) is an essential skill.
Copyright 2005 - 2026 © GizMod.Ru | GizMobi.Ru
При републикации приветствуется ссылка на первоисточник.
Запросов: 8 (0.31417).