Path Interface
The Path object (IAmtPath) is returned by the CreatePath function of the ComScript connection interface. Through this object the paths set for the application, as set in the Control Center, can be retrieved for use in the script. The application used is the application the ComScript module is connected to. The paths can not be changed from inside the script only read.Properties
Name | Type | Access | Description |
ApplicationPath | String | Readonly | The path to the root directory of the application as set in the Control Center. |
AppName | String | Read/Write | The current application name. |
CallPath | String | Readonly | The path to the callable executables of the application. |
ErrorCode | Integer | Readonly | Nonzero when an error has occurred in the Path object. |
ErrorDescription | String | Readonly | When an error has occurred (or no error), the description of the error. |
ExtractPath | String | Readonly | The path to the directory of the extract files of the application. |
HelpPath | String | Readonly | The path to the directory of the help files of the application. |
ListBoxPath | String | Readonly | The path to the directory of the Listbox files of the application. |
LoggingPath |
String |
Readonly |
The path to the directory of the logfiles of the application. |
PrintPath | String | Readonly | The path to the directory of the Print files of the application |
ReportPath | String | Readonly | The path to the directory of the Programs of the application. |
ScriptPath | String | Readonly | The path to the directory of the Scripts of the application. |
Functions
Function Name | Return Type | Parameters | Description | |
Name | Type | |||
ApplicationPathByAppName | String | AppName | String | Returned is the path to the root directory of the application given in AppName. |
ExtractPathByAppName | String | AppName | String | Returned is the Extract path of the application given in AppName. |
LoggingPathByAppName | String | Appname | String | Returned in the Logging path of the application given in AppName. |
PrintPathByAppName | String | AppName | String | Returned is the Print path of the application given in AppName. |
ReportPathByAppName | String | AppName | String | Returned is the Programs path of the application given in AppName. |
ScriptPathByAppName | String | AppName | String | Returned is the Script path of the application given in AppName. |
Example
PowerShell
# See ComScript Connection Interface
...
$ComScr.Connect()
#Create an Object of the Path Interface to be able to retrieve application paths.
$Paths = $ComScr.CreatePath()
$TestExtractPath = $Paths.ExtractPath
$CMAppPath = $Paths.ApplicationPathByAppName('CUSTOMER_MANAGEMENT')
if ($Paths.ErrorCode -ne 0) {
[void]$Msg.AddMsgInformation("ErrorCode is: $($Paths.ErrorCode)")
[void]$Msg.AddMsgInformation("ErrorDescription is: $($Paths.ErrorDescription)")
}
# Finally release the variables and clean up the session.
$ComScr.Dispose()