Previous Topic: NetGetMap - Retrieve a Network Resource NameNext Topic: NetUnMap - Cancel the Redirection


NetMap - Map a Local Device to a Network Resource

Valid on Windows and Windows CE

The NetMap function maps a local device to a network resource.

Function format:

NetMap(device as String, service as String, password as String) as Boolean 
NetMap(device as String, service as String) as Boolean
device

Specifies the local drive or device to be redirected. (Valid values are A: through Z: and LPT1: through LPT3:)

service

Specifies the name of the network resource to which the local device is to be redirected.

password

Identifies an optional string specifying the password for the network resource.

On successful completion, the function returns TRUE; otherwise, returns FALSE.

Example:

This example maps the AM sector share, displays the share and un-maps it again.

If SectorService <> "" Then
 If NetMap("U:",SectorService) Then
  MessageBox("U: Is Mapped to " + NetGetMap("U:"))
  NetUnMap("U:")
 Else	
  MessageBox("Could not map Sector Share")
 Endif
Else
 MessageBox("Could not find Sector Share Name")
EndIf