我制作了一个简单的 VBScript 文件来启用任务管理器。 但是当我执行它时,我收到错误“注册表项中的根无效” 为什么?
set Shell=CreateObject("Wscript.Shell")
shell.regwrite "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Microsoft\Windows\System\DisableTaskMgr","0","REG_DWORD"
将此添加到 WScript.Shell 下面的代码中:
RunAsAdmin()
Function RunAsAdmin()
If WScript.Arguments.length = 0 Then
CreateObject("Shell.Application").ShellExecute "wscript.exe", """" & _
WScript.ScriptFullName & """" & " RunAsAdministrator",,"runas", 1
WScript.Quit
End If
End Function
这将以管理员身份运行脚本。如果它不起作用,请检查您的注册表路径,因为它可能不正确。
该解决方案导致此错误=>“需要对象”
请帮忙解决问题...
谢谢...