verdrm Posted July 15, 2010 Share Posted July 15, 2010 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 More sharing options...
verdrm Posted July 15, 2010 Author Share Posted July 15, 2010 For anyone interested in reading a registry key: $shell= new COM('WScript.Shell'); $data=$shell->regRead('HKEY_LOCAL_MACHINE\PATH TO ENTRY'); Link to comment https://forums.phpfreaks.com/topic/207834-read-registry/#findComment-1086503 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.