RegConnect

Connects to a predefined registry handle on another computer.

Syntax:

RegConnect(computername, handle [, remoteOSflag])

Parameters:

(s) computername the name of the computer in the form of "\\computername".

(i) handle either @REGMACHINE OR @REGUSERS

(s) remoteOSflag [optional] indicate the processor acrhitecture or 'bitness' used by the remote operating system.

Returns:

(s) handle to the specified handle on the remote computer.

 

remoteOSflag

Optional parameter that indicates the processor architecture or 'bitness' used by the remote operating system. Set the optional parameter to the string "RemoteOS32", if the remote computer is running a 32-bit version of Windows and the computer running the script is using a 64-bit version of Windows. Set the optional parameter to "RemoteOS64", if the remote computer is running a 64-bit version of Windows and the computer running the script is using 32-bit version of Windows. If the remote computer and the computer running the script are using the same bitness, do not supply a value for this parameter.

When a handle returned by RegConnect is no longer needed, it should be closed by calling RegCloseKey.

May need to call wntCancelCon, if explicitly connected to the IPC$ share (i.e., via wntAddDrive).

Windows Vista/2008 and newer: This function may require an Administrator level account.

Example:


Fred=RegConnect("\\FRED", @REGMACHINE, "")
Iver=RegQueryValue(Fred, "SOFTWARE\Microsoft\Internet Explorer[Iver]")
RegCloseKey(Fred)
Message("Internet Explorer Version Installed on \\Fred.", Iver)
See Also:

RegCreateKey, RegCloseKey, RegDeleteKey, RegSetValue, RegQueryValue, RegQueryKey, and the section on Registration Database Operations