Stuart McLachlan
stuart at lexacorp.com.pg
Wed Dec 27 17:35:08 CST 2006
On 28 Dec 2006 at 10:09, Darren DICK wrote:
> What I wanted was a line or two that I could just drop at the top of the
> batch file that will reconnect to the drives and send usernames and
> passwords with it without having to remember to open My Computer and double
> click the drives
"Net use"
Connects a computer to or disconnects a computer from a shared resource, or
displays information about computer connections. The command also controls
persistent net connections.
net use [devicename | *] [\\computername\sharename[\volume]] [password |
*]] [/user:[domainname\]username] [[/delete] | [/persistent:{yes | no}]]
net use devicename [/home[password | *]] [/delete:{yes | no}]
net use [/persistent:{yes | no}]
Parameters
none
Used without parameters, net use retrieves a list of network connections.
devicename
Assigns a name to connect to the resource or specifies the device to be
disconnected. There are two kinds of device names: disk drives (D: through
Z:) and printers (LPT1: through LPT3:). Type an asterisk instead of a
specific device name to assign the next available device name.
\\computername\sharename
Specifies the name of the server and the shared resource. If computername
contains blank characters, enclose the entire computer name from the double
backslash (\\) to the end of the computer name in quotation marks (" ").
The computer name may be from 1 to 15 characters long.
\volume
Specifies a NetWare volume on the server. You must have Client Service for
NetWare (Windows 2000 Professional) or Gateway Service for NetWare (Windows
2000 Server) installed and running to connect to NetWare servers,
password
Specifies the password needed to access the shared resource.
*
Produces a prompt for the password. The password is not displayed when you
type it at the password prompt.
/user
Specifies a different user name with which the connection is made.
domainname
Specifies another domain. For example, net use d:\\server\share
/user:admin\mariel connects the user identifier mariel as if the connection
were made from the admin domain. If domainname is omitted, the current
logged on domain is used.
username
Specifies the user name with which to log on.
/delete
Cancels the specified network connection. If the user specifies the
connection with an asterisk, all network connections are canceled.
/home
Connects a user to the home directory.
/persistent
Controls the use of persistent network connections. The default is the
setting used last. Deviceless connections are not persistent.
yes
Saves all connections as they are made, and restores them at next logon.
no
Does not save the connection being made or subsequent connections. Existing
connections are restored at the next logon. Use the /delete switch to
remove persistent connections.
--
Stuart