Jump to content

Read Registry


verdrm

Recommended Posts

I found some code that can read Windows registry subkeys. The code works fine.

 

define('HKEY_LOCAL_MACHINE', 0x80000002);
$computer = '.';
$reg = new COM("winmgmts:{impersonationLevel=impersonate}!\\\\$computer\\root\\default:StdRegProv");

$key_path = 'SOFTWARE\NAV32\AntiVirus';
$sub_keys = new VARIANT();
$reg->EnumKey(HKEY_LOCAL_MACHINE, $key_path, $sub_keys);

foreach($sub_keys as $sub_key){
echo "$sub_key\n";
} 

 

However, it only reads the subkeys and not a specific value under a subkey. How can I get a value instead of a subkey? Thanks!

 

 

Link to comment
https://forums.phpfreaks.com/topic/207834-read-registry/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.