[AccessD] Bit OT: Restore Network Connections in a batch file

Darren DICK darrend at nimble.com.au
Wed Dec 27 18:33:09 CST 2006


Hi Stuart

Brilliant - thanks

How's the H3 going?
 
Darren
------------------
T: 0424 696 433

-----Original Message-----
From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg] 
Sent: Thursday, 28 December 2006 10:35 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Bit OT: Restore Network Connections in a batch file

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


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list