Professional Windows Server 1002003 Security A Technical Reference [Electronic resources]

Roberta Bragg

نسخه متنی -صفحه : 415/ 344
نمايش فراداده

net use

Manages connections with shared resources.

Syntax

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}]

Options

None

A list of current network connections.

devicename

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.)

\\computername\sharename[\volume]

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 | *]

Password required for the resource. An asterisk causes a prompt for the password when the command is run.

/user:[domainname\]username

Domain to connect from and username to use for establishing the connection (if required). If domainname is omitted, the current logon domain is used.

/delete

Termination of the connection. (If an asterisk is used for the connection, all network connections are disconnected.)

/home[password | *]

Connection of a user to the home directory.

/persistent:[yes | no]

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).

Examples

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.

Notes

  • 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.

See Also

net file, net session, net share, net view,

Shared Folders