标签: ERROR: Access to the registry path is denied.; Windows Server 2019 DataCenter;
在Windows Server 2019 DataCenter中打开“Windows PowerShell”(以管理员方式运行),执行以下命令,
setx SPEECH value123
报以下错误:
ERROR: Access to the registry path is denied.
挺奇怪的, PowerShell已经以管理员方式运行了, 居然还是报上面错误。
尝试了多种办法,最终解决办法如下:
https://stackoverflow.com/questions/15664968/run-as-administrator-but-still-requested-registry-access-is-not-allowed
- get psexec.exe from here: https://learn.microsoft.com/en-us/sysinternals/downloads/psexec
- use psexec.exe -i -s powershell.exe to start a new interactive (-i parameter) powershell.exe window as user Local System (-s parameter).
- Inside that new powershell window try your command again.
从微软官网下载psexec.exe,然后以psexec.exe启动powershell.exe,再去执行setx SPEECH value123命令。就不报错误了,成功了。
作者简介:https://shimo.im/docs/rp3OVwxle2fJn7Am/
上海徐汇
2023年11月7日