立即与支持人员聊天
与支持团队交流

InTrust 11.4.2 - Customization Kit

Folder

NAME

TYPE

DESCRIPTION

Files

array of File objects

Provides a list of files contained within the folder.

SubFolders

array of Folder objects

Provides a list of folders contained within a folder.

Name

property

Returns the name of the folder.

Path

property

Returns the full path to the folder.

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" );

相关文档

The document was helpful.

选择评级

I easily found the information I needed.

选择评级