PHP, Win32, and COM Objects... Oh my..
Posted: Thu Jul 28, 2005 12:17 pm
I am trying to print out the list of sub-keys as you can see. However, when I run it, the PHP cli program crashes. Does anyone have any ideas as to what I've done wrong here?
Code:
Code:
Code: Select all
<?php
$hostname = ".";
$keyPath = "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
$wshShell = new COM("winmgmts:{impersonationLevel=impersonate}//{$hostname}/root/default:StdRegProv");
$wshShell->EnumKey("HKEY_LOCAL_MACHINE", $keyPath, $keys);
foreach($keys as $key){
print $key;
}
unset($wshShell);
?>