VB script

  • Thread starter Thread starter William St.Clair
  • Start date Start date
W

William St.Clair

I am writing a script to map a network drive and I need
to use a alternate username & password. Does anyone know
what the syntax is to include a username and password
when writing a vb script to map a network drive?

Thanks for any help
William
 
--------------------
Content-Class: urn:content-classes:message
From: "William St.Clair" <[email protected]>
Sender: "William St.Clair" <[email protected]>
Subject: VB script
Date: Thu, 27 May 2004 08:06:19 -0700

I am writing a script to map a network drive and I need
to use a alternate username & password. Does anyone know
what the syntax is to include a username and password
when writing a vb script to map a network drive?

Thanks for any help
William
-----------------

The syntax of this command is:
NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]
NET USE {devicename | *} [password | *] /HOME
NET USE [/PERSISTENT:{YES | NO}]

--
~~ JASON HALL ~~
~ Performance Support Specialist,
~ Microsoft Enterprise Platforms Support
~ This posting is provided "AS IS" with no warranties, and confers no
rights.
~ Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
~ Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 
I am writing a script to map a network drive and I need
to use a alternate username & password. Does anyone know
what the syntax is to include a username and password
when writing a vb script to map a network drive?

Pasted directly from the docs:

object.MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile],
[strUser], [strPassword])

Arguments

object
WshNetwork object.

strLocalName
String value indicating the name by which the mapped drive will be
known locally.

strRemoteName
String value indicating the share's UNC name (\\xxx\yyy).

bUpdateProfile
Optional. Boolean value indicating whether the mapping information is
stored in the current user's profile. If bUpdateProfile is supplied
and has a value of true, the mapping is stored in the user profile
(the default is false).

strUser
Optional. String value indicating the user name. You must supply this
argument if you are mapping a network drive using the credentials of
someone other than the current user.

strPassword
Optional. String value indicating the user password. You must supply
this argument if you are mapping a network drive using the credentials
of someone other than the current user.
 

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