Hitachi

JP1 Version 12 JP1/IT Desktop Management 2 - Asset Console Creating an Access Definition File Guide


$GETPROFILEDATA (get Windows initialization file data)

$GETPROFILEDATA reads all keys and values in the specified section of the specified Windows initialization file name into an array variable. The keys in the section are stored as array key values.

Organization of this page

Syntax

$GETPROFILEDATA(Windows-initialization-file-name,section-name,array-name)

Values

Status

The following table lists and describes the possible statuses:

Status

Description

NORMAL

Normal end

NODATA

Indicates one of the following:

  • The Windows initialization file does not exist.

  • The specified section does not exist.

ERROR

Script execution interrupted

An invalid argument was specified, or an error other than the above occurred.

Legend:

—: Not applicable

Example

The following example acquires values from the section TITLE and the key name HardwareInfo from the Windows initialization file Sample.ini:

[SET_VALUE]
  FILENAME = 'Sample.ini'
  SECTION  = 'TITLE'
 
  $GETPROFILEDATA(FILENAME, SECTION, ARY)
  VAL=$GETARRAYBYKEY(ARY, 'HardwareInfo')
  MSG = 'HardwareInfo = ' + VAL
  $ECHO(MSG)

Sample.ini file

[TITLE]
  AssetInfo    = Asset Information
  HardwareInfo = Hardware Information
  SoftwareInfo = Software Information
Execution result:

HardwareInfo = Hardware Information