Internet and Network Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Internet and Network >

Internet and Network Commands

CNS. - Connect Network Share

Previous Top Next


MiniRobotLanguage (MRL)

 

CNS. Command

Connect Network Share

 

 

Intention

 

Can be used to makes a connection to a network resource and can redirect a local device to the network resource.

 

Just use the command and specify which Mapping you want:

 

CNS.\\MyComputer\Folder$

 

CNS.\\MyComputer\Folder$|MyLogin|MyPassword

 

' Make permanent connection

CNS.\\MyComputer\Folder$|MyLogin|MyPassword|1

 

' Make connection only until reboot (temporary)

CNS.\\MyComputer\Folder$|MyLogin|MyPassword|1

 

In case of error, the timeout-flag is set and the error-number is on the TOS.

 

Hint: Use the RDM. - Remove Drive Mapping command to remove a mapped drive.

 

 

Syntax

 

 

CNS.P1[|P2][|P3][|P4][|P5]

 

 

Parameter Explanation

 

P1  - Share to connect, example:  \\computer\folder

 

P2  - (optional)  Username

 

P3  - (optional)  Password

 

P4 - (optional). 1/0 -If 1 is specified, the connection is permanent.

      It will be restored at the next reboot.

      If 0 or nothing is specified, the connection is temporary

      and not saved in the user profile.

 

P5 - (optional).  Variable that will return the result of  the operation. In case of

      success the result will be zero. In case of error an error number is returned.

      If omitted TOS is used.

 

 

5 - ERROR_ACCESS_DENIED

The caller does not have access to the network resource.

This could also be a access-rights problem.

 

85 - ERROR_ALREADY_ASSIGNED

The local device specified is already connected to a network resource.

 

1200 - ERROR_BAD_DEVICE

The value specified is invalid.

 

67 - ERROR_BAD_NET_NAME

The value specified is not acceptable to any network resource provider because the resource name is invalid, or because the named resource cannot be located.

 

1204 - ERROR_BAD_PROVIDER

The value specified does not match any provider.

 

1223 - ERROR_CANCELLED

The attempt to make the connection was canceled by the user through a dialog box from one of the network resource providers, or by a called resource.

 

1208 - ERROR_EXTENDED_ERROR

A network-specific error occurred.

 

487 - ERROR_INVALID_ADDRESS

The caller passed a pointer to a buffer that could not be accessed.

This error should not appear, as it is an internal error.

 

87 - ERROR_INVALID_PARAMETER

This error is a result of providing wrong parameters, or the connection is to a

 network that requires the redirecting of a local device. Please check the variables.

 

86 - ERROR_INVALID_PASSWORD

The specified password is invalid.

 

234 - ERROR_MORE_DATA

Internal Error. If this error is returned, then no connection has been made.

 

259 - ERROR_NO_MORE_ITEMS

The operating system cannot automatically choose a local redirection because all the valid local devices are in use.

 

1202 - ERROR_DEVICE_ALREADY_REMEMBERED

The local device name has a remembered connection to another network resource.

 

1203 - ERROR_NO_NET_OR_BAD_PATH

The network path was either typed incorrectly, does not exist, or the network provider is not currently available. Please try retyping the path or contact your network administrator.

 

1222 - ERROR_NO_NETWORK

The network is unavailable.

 

1219 - ERROR_SESSION_CREDENTIAL_CONFLICT

An attempt was made to establish a session to a network server, but there are already too many sessions established to that server.

 

1326 - ERROR_LOGON_FAILURE

Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced.

 

 

 

 

Example

 

'-----------------------------------------------------------

' CNS. - No Pasword

'

$$PAT=\\XDRIVE\Daten$

CNS.$$PAT

ITO.

 PRT.error happend

EIF.

DMP.6

MBX.!

ENR.

 

' CNS. - with Pasword

'

$$PAT=\\XDRIVE\Daten$

CNS.$$PAT|Admin|Asjfds_55

ITO.

 PRT.error happend

EIF.

DMP.6

MBX.!

ENR.

 

 

 

 

Remarks

 

If the command fails, the Timeout-Flag is set, otherwise it will be cleared.

 

 

 

Limitations:

 

-

 

 

See also:

 

    MND. - Map Network Drive

    RDM. - Remove Drive Mapping

    GIP. - Get IP Adress

    GUN. - Get User Name

    IVA. - If Volume available