Posted by awsewell on 11/12/03 11:22
I am trying to use windows com objects to interact with the windows registry, here is my code:
<?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);
?>
When I try to run this script, I get an error that PHP (5.04) has crashed. Am I doing something wrong or does PHP not support what I am trying to do?
Thanks.
[Back to original message]
|