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! Quote Link to comment 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'); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.