login scripts

  • Thread starter Thread starter Ellak
  • Start date Start date
E

Ellak

Hello

Is there a way to pass a username and password to access a network share in
login script? I tried:

net use X: \\servername\service$ /user:Username Password

This works when typed manually to command prompt but it doesn'd work in a
script (login.bat).

I need to give few users access to a share in a non-domain-member-server. I
know it can be done by giving identical usernames and passwords to domain
and to standalone server but I can't cause I don't know user passwords an
passwords are set to change once a month.

Any other way or is it just give the username in script and instruckt user
to type the password manually?

Thanks

Ellak
 
Actually there is a News Group SPECIFIC to this type of discussion:
microsoft.public.windows.server.scripting


You should use a REAL Script Interpreter, not that batch languange, susch as Kixtart {
http://kixtart.org , KixTart is CareWare)

You would use the folowing Kixtart command.

Use

Action: Enables you to list the current connections. Also enables you to connect a device,
such as a drive or a printer, to a network resource; or to disconnect a device from a
network resource.

Syntax: USE LIST
USE < "*" | "device" | "resource"> /DELETE [/PERSISTENT]
USE ["device"] <"resource"> [/USER:user] [/PASSWORD:password] [/PERSISTENT]

Remarks: Use USE "*" /DELETE to delete all current connections except those to a NETLOGON
share and those to the drive or share from which KiXtart was started.
If a resource name contains non-alphanumeric characters (such as - or +), you must enclose
the name in quotation marks.

On Windows NT only, you can use the /USER and /PASSWORD parameters, which allows you to
override the security context of the current user.

Check the value of @error to see if USE was successful (a value of 0 indicates success).


Examples: USE E: "\\SERVER\PUBLIC" /PERSISTENT
USE "*" /DELETE
USE E: "\\SERVER\PUBLIC" /user:Yogi /password:Bear
USE E: "\\SERVER\PUBLIC"
USE LPT1: "\\SERVER\LASER" /user:testlan\USER1
USE L: /DEL
USE LIST
USE H: @HOMESHR ; connect to user's home share
IF @error = 0
H:
CD @HOMEDIR ; change directory to user's home directory
ENDIF

~ ~ ~

Dave

PS: Follow-up set to: microsoft.public.windows.server.scripting



| Hello
|
| Is there a way to pass a username and password to access a network share in
| login script? I tried:
|
| net use X: \\servername\service$ /user:Username Password
|
| This works when typed manually to command prompt but it doesn'd work in a
| script (login.bat).
|
| I need to give few users access to a share in a non-domain-member-server. I
| know it can be done by giving identical usernames and passwords to domain
| and to standalone server but I can't cause I don't know user passwords an
| passwords are set to change once a month.
|
| Any other way or is it just give the username in script and instruckt user
| to type the password manually?
|
| Thanks
|
| Ellak
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top