Databases Reference
In-Depth Information
Hive
Decimal Value
Hexidecimal Value
HKEY CLASSES ROOT
2147483648
0x80000000
HKEY CURRENT USER
2147483649
0x80000001
HKEY LOCAL MACHINE
2147483650
0x80000002
HKEY USERS
2147483651
0x80000003
HKEY CURRENT CONFIG
2147483653
0x80000005
HKEY DYN DATA
2147483654
0x80000006
To get a list of service names listed as subkeys under the SYSTEM\CurrentControlSet\Services key in
the HKEY LOCAL MACHINE registry hive, you can use the Enumkey method. This method accepts a
hive constant and a registry path. In this case, you pass the value of the HKEY LOCAL MACHINE hive
and the path SYSTEM\CurrentControlSet\Services, as shown in the following command:
$Reg = [WMIClass]"root\default:stdRegProv"
$HKEY_LOCAL_MACHINE = 2147483650 $strKeyPath = "SYSTEM\CurrentControlSet\Services"
$services = $Reg.EnumKey($HKEY_LOCAL_MACHINE,$strKeyPath)
$services.sNames
Figure 8-35 shows part of the services.
Figure 8-35
Search WWH ::




Custom Search