General discussion

Locked

VB script problem

By tamj123 ·
Hi,

Is there any way include user name with password to map a network share in VB script. example: username: mejhone password: support, network shard: \\csg_app\merchshare

can this be done?

Thank you.

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by p.j.hutchison In reply to VB script problem

No I would not recommend to do it that way. Best way is to assign permissions on ther server to allow users access to shares and then map the drive normally.

Collapse -

by tamj123 In reply to

I know it is not a good idea to do this, I have my reason to do this way.

Collapse -

by tamj123 In reply to

not what i asking. i need this to be part of my vb login script.

Collapse -

by clark_nick2002 In reply to VB script problem

If you put this in your logon script it should do what you want.

Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "E:", "\\Your_Server\share_name"

This will use the username and password of the user who is logging on.
you can put "username@domain","password" at the end if you want.

i.e. if you wish to map a share user2 can access but user1 can't to user1's account do the following in user1's logon script

Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "E:", "\\Your_Server\share_name","user2@domain","user2_password"

Good luck

Collapse -

by tamj123 In reply to

Poster rated this answer.

Collapse -

by tamj123 In reply to VB script problem

This question was closed by the author

Back to Windows Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums