Chat now with support
Chat with Support

InTrust 11.3.2 - Customization Kit

RegKey

NAME

TYPE

DESCRIPTION

RegKey([key])

constructor

Constructs a new RegKey instance.

Connect(key, computer)

method

Call this method to connect to the key of the remote registry.

Open(key, subkey)

method

Call this method to open the specified subkey.

GetDWORD(valuename)

method

Retrieves a DWORD value.

GetString(valuename)

method

Retrieves a string value.

GetMultiString(valuename)

method

Retrieves a multiline string value and returns an array of the strings.

IsValid

property

Indicates whether the registry key is valid.

HKEY_CLASSES_ROOT

static property

Returns a new RegKey object pointing to HKCR key.

HKEY_CURRENT_USER

static property

Returns a new RegKey object pointing to HKCU key.

HKEY_LOCAL_MACHINE

static property

Returns a new RegKey object pointing to HKLM key.

HKEY_USERS

static property

Returns a new RegKey object pointing to HKU key.

HKEY_PERFORMANCE_DATA

static property

Returns a new RegKey object pointing to HKPD key.

HKEY_CURRENT_CONFIG

static property

Returns a new RegKey object pointing to HKCC key.

HKEY_DYN_DATA

static property

Returns new RegKey object pointing to HKDD key.

 

Example

The following script determines whether HKCR is valid and retrieves some values from the HKCU\Sofrware\mykey key.

try
{
    var rk = new RegKey();
    rk.Connect(RegKey.HKEY_CURRENT_USER, "server");
    rk.Open(rk, "Software\\mykey");
    print("string=" + rk.GetString("StringValue"));
    print("dword=" + rk.GetDWORD("DWORDValue"));
    print("multistring=");
    var ms = rk.GetMultiString("Multiline string value");
    for (x in ms) {
        print(ms[x]);
    }
}
catch (err)
{
    print("Error: " + err);
}

ScriptExecObject

NAME

TYPE

DESCRIPTION

StdErr

property

Provides access to the stderr output stream of the object. Read-only.

StdOut

property

Provides access to the stdout output stream of the object. Read-only.

Wait

method

Waits until process return.

Terminate

method

Ungracefully terminates the process.

ShellObject

NAME

TYPE

DESCRIPTION

ExpandEnvironmentStrings(strString)

method

Returns an environment variable's expanded value. Variables in strString should use the % character.

Exec(strCommand)

method

Unix only.

Runs an application in a child command-shell, providing access to the StdOut and StdErr streams.

The Exec method returns a ScriptExecObject, which provides status and error information about a script run with Exec along with access to the StdOut and StdErr channels.

Read(arrStreams, nCharCount)

static method

Reads a number of characters specified by nCharCount from any available streams in arrStreams. Also sets a Signaled property of the arrStreams array to the index of a signaled stream.

ReadLine(arrStreams)

static method

Reads a line from any available streams in arrStreams. Also sets a Signaled property of the arrStreams array to the index of a signaled stream.

AtEndOfAllStreams(arrStreams)

static method

Checks whether all streams in the arrStreams array are at the end of the stream.

Example

var sh = new ShellObject();
print(sh.ExpandEnvironmentStrings("PATH=%PATH%"));
var ls = sh.Exec("ls -l");
var out = ls.StdOut;
while (!out.AtEndOfStream) {
    s = out.ReadLine();
    print( s+"\n" );

SystemInformationObject

NAME

DESCRIPTION

GetComputerName(address)

Retrieves the NetBIOS or DNS name associated with the specified computer address.

The address parameter is a NetBIOS name. If the parameter is not specified, the method works with the local computer.

GetDomainName(address)

Retrieves the domain name.

The address parameter is a NetBIOS name. If the parameter is not specified, the method works with the local computer.

GetComputerRole(address)

Retrieves the computer role.

The address parameter is a NetBIOS name. If the parameter is not specified, the method works with the local computer.

GetPlatformId(address)

Retrieves the platform ID.

The address parameter is a NetBIOS name. If the parameter is not specified, the method works with the local computer.

GetVersionMajor(address)

Retrieves the major number of the operating system version of the computer with the specified address.

The address parameter is a NetBIOS name. If the parameter is not specified, the method works with the local computer.

GetVersionMinor(address)

Retrieves the minor number of the operating system version of the computer with the specified address.

The address parameter is a NetBIOS name. If the parameter is not specified, the method works with the local computer.

GetTimeOfDayInfo(address)

Returns a TimeOfDayInfoObject object.

The address parameter is a NetBIOS name. If the parameter is not specified, the method works with the local computer.

IsLocalHost(address)

Verifies whether the specified address (or computer name) is the address of the local computer.

The address parameter is a NetBIOS name or an IP address. If the parameter is not specified, the method works with the local computer.

Example

The following script displays all available information about the "SERVER" computer.

try
{
    var si = new SystemInformationObject();
    print(si.GetComputerName("server"));
    print(si.GetDomainName("server"));
    print(si.GetPlatformId("server"));
    print(si.GetVersionMajor("server"));
    print(si.GetVersionMinor("server"));
    print(si.IsLocalHost("server"));
    
    var ti = si.GetTimeOfDayInfo("server");
    print(ti.elapsedt);
    print(ti.msecs);
    print(ti.hours);
    print(ti.mins);
    print(ti.secs);
    print(ti.hunds);
    print(ti.timezone);
    print(ti.tinterval);
    print(ti.day);
    print(ti.month);
    print(ti.year);
    print(ti.weekday);
}
catch (err)
{
    print("Error: " + err);
}

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating