Opening a registry key, listing keys, and closing the registry key (Windows version only)
The OPEN WINKEY, LIST WINKEYS, and CLOSE WINKEY commands are similar to the OPEN KEY, LIST KEYS, and CLOSE KEY commands described in section 3, except that they are working with the registry of a running Windows system (as are all commands in this section). The following example opens the System key, assigns the key to 0, lists any subkeys contained within the key, and then closes the key. The System key is located in HKLM branch of the registry (HKEY_LOCAL_MACHINE). Note that the branch of the registry under which the key exists must be specified when using the OPEN WINKEY command.
OPEN WINKEY 0 System HKLM
Open the System key in HKLM branch and assign to 0
LIST WINKEYS 0 System
List subkeys in the System key
CLOSE WINKEY 0
Close the System key assigned to 0
Creating and deleting a registry key (Windows version only)
The following example uses the OPEN WINKEY command with the /c option to create and open a new key under the System key in the HKLM branch of the registry. It then creates a new subkey under the new key. It then opens the System key itself and deletes both the new key and the subkey under it with the DEL WINKEY command using the /s option.
OPEN WINKEY 0 System\Test HKLM /c
Create & open Test key under System and assign it to 0
OPEN WINKEY 1 System\Test\SubKey HKLM /c
Create & open SubKey key under the Test key
OPEN WINKEY 2 System HKLM
Open the System key itself
DEL WINKEY 2 Test /s
Delete the Test key and the SubKey key under it
Listing, Setting, and Deleting Registry Values (Windows version only)
The LIST WINVALUE, LIST WINVALUES, SET WINVALUE, and DEL WINVALUE commands work in similar fashion to the LIST VALUE, LIST VALUES, SET VALUE, and DEL VALUE covered in section 3. The following example commands demonstrate their use.
OPEN WINKEY 0 System\Setup HKLM /c
Open the System\Setup key and assign it to 0
LIST WINVALUE 0 CmdLine
List the value of CmdLine in Setup key
LIST WINVALUES 0
List the names of all values in Setup key
LIST WINVALUES 0 /d
List the names and values of all values in Setup key
SET WINVALUE 0 SetupType dword 0x1
Set the value of SetupType value in Setup key to 0x1