username and password both are of datatype STRING, so you will have to put doublequotes around them,

try this one,

Set objNet = CreateObject("Wscript.Network")

strUser = "IPCUSER"
strPasswd = "Password"
strMapDrive = "I:"
strNetPath = "\\10.1.0.103\DESKTOP_CFG"
bIsPersistent = False 

MsgBox "Mapping Drive letter for IPCC Access"

'// next line required in case I: drive is not present
On Error Resume Next
objNet.RemoveNetworkDrive "I:" , True

objNet.MapNetworkDrive strMapDrive, strNetPath, bIsPersistent, strUser, strPasswd


Also, r u sure you want to put password in plain script like this?
why the drive should be mapped with single user account for I guess many users?
can't you give the required group of users access onto that share, so that you don't have to put username and password in script?


-
Kamlesh
On 10/13/05, Harding, Devon <[EMAIL PROTECTED]> wrote:

I seem to getting a syntax error on the comma or space after the username.

 


From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Crawford, Scott
Sent: Thursday, October 13, 2005 11:49 AM
To: [email protected]
Subject: RE: [ActiveDir] Authenticated drive mapping via .vbs

 

Set objNet = CreateObject("Wscript.Network")

MsgBox "Mapping Drive letter for IPCC Access"

objNet.RemoveNetworkDrive "I:"

objNet.MapNetworkDrive "I:", "\\10.1.0.103\DESKTOP_CFG", False, ipccuser, password

 

I've attached the script I use for mapping drives on all our clients.  It's a little customized for our environment, but it allows you to map based on group (included nested) membership as well as characteristics of the IP address.

 


From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Harding, Devon
Sent: Thursday, October 13, 2005 10:10 AM
To: [email protected]
Subject: [ActiveDir] Authenticated drive mapping via .vbs

 

What would be the correct way to convert this batch file to a .vbs?

 

Echo Mapping Drive letter for IPCC Access

if exist i:\ net use i: /delete

net use i: \\10.1.0.103\DESKTOP_CFG password  /user:ipccuser /PERSISTENT:NO

 

Devon Harding

Windows Systems Engineer

Southern Wine & Spirits - BSG

954-602-2469

 


__________________________________
This message and any attachments are solely for the intended recipient
and may contain confidential or privileged information. If you are not
the intended recipient, any disclosure, copying, use or distribution of
the information included in the message and any attachments is
prohibited. If you have received this communication in error, please
notify us by reply e-mail and immediately and permanently delete this
message and any attachments. Thank You.




--
~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Fortune and Love befriend the bold"
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to