How do I create a new registry value using PHP?
The following code doesn't work:
function registry_write($folder, $key, $value, $type="REG_SZ")
{
$WshShell = new COM("WScript.Shell");
$registry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\" . $folder . "\\" . $key;
//$result = $WshShell->RegRead($registry);
$result = $WshShell->RegWrite($registry, $value, $type);
return($result);
}
$folder = "7-ZIP";
$key = "Mac";
$value = "123";
registry_write($folder,$key,$value);
There already is a key named 7-ZIP
inside HKEY_LOCAL_MACHINE\SOFTWARE
.
There is no entry in error.log inside apache/logs.
To : Tomalak How do I modify those permissions/identities? Is there a way to do it with php?
What am I trying to do : I have an Adobe AIR application which I am bundling with MySql and PHP. When this application is installed on a machine I want to put some information about the machine in the registry, so that every time the application runs I can verify if it has not been pirated.