读取结束注册表值时,PHP RegRead失败 [英] PHP RegRead failing when reading end registry value
问题描述
场景:
我正在尝试从Windows注册表中读取值,我能够读取除结尾处的所有内容.
代码:
Scenario:
I am trying to read values from windows registry, i was able to read everything except the end ones.
Code:
$shell = new COM("WScript.Shell") or die("Requires Windows Scripting Host");
$devenvpath1=$shell->RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Intel\\Chipset\\Language"); //This is working
代码:
Code:
$shell = new COM("WScript.Shell") or die("Requires Windows Scripting Host");
$devenvpath1=$shell->RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Intel\\Chipset\\Uninstall\\registry0");//This is not working and giving an error shown below
错误:
致命错误:消息"源: WshShell.RegRead
描述:注册表项"HKEY_LOCAL_MACHINE \ SOFTWARE \ Intel \"中无效的根未捕获的异常"com_exception" Chipset \ Uninstall \ registry0."位于C:\ Program Files \ report.php:4堆栈跟踪中:#0 C:\ Program Files \ report.php(4):com-> RegRead(''HKEY_LOCAL_MACH. .'')#1 {main}在第4行的C:\ Program Files \ report.php中抛出
Windows注册表视图:
MyComputer
|
| HKEY_LOCAL_MACHINE
>>>> |
>>>> |软件
>>>>>> |
>>>>>> || Intel
>>>>>>>>>> |
>>>>>>>>> || ChipSet | ----默认
>>>>>>>>>>>> | ----语言
>>>>>>>>>>>> | ----版本
>>>>>>>>>>>>>>> |
>>>>>>>>>>>> || UnInstall | ----- Default
>>>>>>>>>>>>>> || --- registry0
为什么我在注册表错误中得到无效的根目录?有任何建议或解决方案吗?
error:
Fatal error: Uncaught exception ''com_exception'' with message ''Source: WshShell.RegRead
Description: Invalid root in registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Intel\Chipset\Uninstall\registry0".'' in C:\Program Files\report.php:4 Stack trace: #0 C:\Program Files\report.php(4): com->RegRead(''HKEY_LOCAL_MACH...'') #1 {main} thrown in C:\Program Files\report.php on line 4
View of Windows registry:
MyComputer
|
|HKEY_LOCAL_MACHINE
>>>>|
>>>>|SOFTWARE
>>>>>>>|
>>>>>>>|Intel
>>>>>>>>>>|
>>>>>>>>>>|ChipSet|----Default
>>>>>>>>>>>>>| |----Language
>>>>>>>>>>>>>| |----Version
>>>>>>>>>>>>>|
>>>>>>>>>>>>>|UnInstall|-----Default
>>>>>>>>>>>>>>>>|-----registry0
Why am i getting the Invalid root in the registry error? Any suggestions or solutions?
推荐答案
shell = new COM(" WScript.Shell")" );
shell = new COM("WScript.Shell") or die("Requires Windows Scripting Host");
devenvpath1 =
devenvpath1=
shell-> RegRead(" ); // 这正在起作用
shell->RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Intel\\Chipset\\Language"); //This is working
代码:
Code:
这篇关于读取结束注册表值时,PHP RegRead失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!