Win32 COM help
| From: | awsewell at catawba dot edu | Date: | Thu, 28 Jul 2005 20:10:03 +0000 |
| Subject: | Win32 COM help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-219559@lists.php.net to get a copy of this message | ||
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.