net use |
Manages connections with shared resources.
net use [ devicename *] [\ computername \ sharename [\ volume ] [ password *] ] [ credentials ] [ [/delete] [/persistent:{yes no}] ]
where credentials represents one of:
[/user:[ domainname \] username ] [/user:[ dotted domain name \] username ] [/user:[ username@dotted domain name ] net use { devicename *} [ password *] /home net use [/persistent:{yes no}]
A list of current network connections.
The resource to connect/disconnect. (Specify D : to Z : for drives and LPT1 : to LPT3 : for printers, or use an asterisk to assign the next available device name.)
The shared resource to connect/disconnect. volume represents a NetWare volume to connect/disconnect (requires Client Service for NetWare or Gateway Service for NetWare).
Password required for the resource. An asterisk causes a prompt for the password when the command is run.
Domain to connect from and username to use for establishing the connection (if required). If domainname is omitted, the current logon domain is used.
Termination of the connection. (If an asterisk is used for the connection, all network connections are disconnected.)
Connection of a user to the home directory.
yes makes the connection being made and subsequent connections persistent (saves them and restores them at next logon). no makes the connection being made and subsequent connections nonpersistent, but existing persistent connections remain so (use /delete to remove persistent connections).
Display a list of currently connected mapped network drives:
net use New connections will be remembered. Status Local Remote Network ----------------------------------------------- OK I: \leonardo\swynk Microsoft Windows Network OK J: \leonardo\transfer Microsoft Windows Network The command completed successfully.
Notice that all connections are currently persistent.
View details of I: connection:
net use I: Local name I: Remote name \leonardo\swynk Resource type Disk Status OK # Opens 0 # Connections 1 The command completed successfully.
Display a list of connections on server BACH :
net view \bach Shared resources at \bach Share name Type Used as Comment ------------------------------------------------ NETLOGON Disk Logon server share one Disk source Disk SYSVOL Disk Logon server share test2 Disk test3 Disk y1 Disk y2 Disk y3 Disk The command completed successfully.
Map the drive letter P: to the share TEST2 on BACH :
net use p: \bach\test2 The command completed successfully.
Disconnect mapped drive P : previously connected:
net use p: /delete p: was deleted successfully.
Use quotes to enclose computername if it contains embedded spaces.
You can't disconnect from a share if it is your current drive or if it is locked by an active process.
net file , net session , net share , net view , Shared Folders