badge
03-17-2006, 06:53 AM
Hello,
Im as new to vbs scripting as one can be but I have gotten this script almost finished. With some help I admit :-) I need to map a drive from XP to Solaris and I have this so far and it works.
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUser, strPassword, strProfile
' Values of variables set
strDriveLetter = "X:"
strRemotePath = "\\server\share"
strUser = "name"
strPassword = "whatever"
strProfile = "false"
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, _
strProfile, strUser, strPassword
set objNetwork= nothing
WScript.Quit
It has to be so the usernames and passwords dont need to be typed in. I put the script into the local group policy logon but the problem is any user who logs on executes the script. I need to have the script run only for the user in strUser = "name"
Hope this makes sense. Thanks in advance for any help.
Mike
Im as new to vbs scripting as one can be but I have gotten this script almost finished. With some help I admit :-) I need to map a drive from XP to Solaris and I have this so far and it works.
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUser, strPassword, strProfile
' Values of variables set
strDriveLetter = "X:"
strRemotePath = "\\server\share"
strUser = "name"
strPassword = "whatever"
strProfile = "false"
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, _
strProfile, strUser, strPassword
set objNetwork= nothing
WScript.Quit
It has to be so the usernames and passwords dont need to be typed in. I put the script into the local group policy logon but the problem is any user who logs on executes the script. I need to have the script run only for the user in strUser = "name"
Hope this makes sense. Thanks in advance for any help.
Mike