MapNetworkDrive Method

 

Description

 

Adds a shared network drive to your computer system.

 

PowerBASIC Syntax

 

METHOD MapNetworkDrive ( _

BYVAL bstrLocalName AS STRING, _

BYVAL bstrRemoteName AS STRING, _

OPTIONAL BYREF vUpdateProfile AS VARIANT, _

OPTIONAL BYREF vUserName AS VARIANT, _

OPTIONAL BYREF vPassword AS VARIANT _

)

 

Arguments

 

bstrLocalName

BSTR. The name by which the mapped drive will be known locally.

bstrRemoteName

BSTR. The share's UNC name (\\xxx\yyy).

vUpdateProfile

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

vUserName

Optional. VARIANT. 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.

vPassword

Optional. VARIANT. 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.

 

Remarks

 

An attempt to map a non-shared network drive results in an error.

 

Example [PowerBASIC]

 

#INCLUDE "WSHOM.INC"

 

DIM pWshNetwork AS IWshNetwork

DIM bstrLocalName AS STRING

DIM bstrRemoteName AS STRING

 

pWshNetwork = NEWCOM "WScript.Network"

bstrLocalName = UCODE$("LPT1")

bstrRemoteName = UCODE$("\\Server\Print1")

pWshNetwork.MapNetworkDrive UCODE$("E:"), UCODE$("\\Server\Public")

 

Valid XHTML 1.0 Transitional