Code: Select all
$shell = new COM('WScript.Shell');
$shell->RegWrite(
$ureg_key . 'Path', $user_path_string, 'REG_EXPAND_SZ'
);Unfortunately, even though the registry is properly written to, it doesn't seem like Windows realizes that the environment has changed (not even when I reboot explorer). Apparently, I have to send a message to all the Windows in order to notify them of the change. I, unfortunately, have no idea how to do this with COM. Any ideas?
I'm currently working around this by executing an external setenv utility, but a built in PHP solution would be ideal.