Disable/Enable 带有 VBS 的任务管理器

Disable/Enable Taskmanager with VBS

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.Run "calc" ,,true   
msgbox "Calc finished"
WSHShell.Run "userinit.exe" 

我需要从脚本开始禁用 Taskmanager,直到 userinit.exe 被执行。我正在使用 Win 7,但我不知道该怎么做。 (我搜索了很多但没有任何结果)

您可以设置注册表值,使用注册表编辑器 cmdline 等同于:reg.exe。这是一个例子:

WSHShell.Run("Reg.exe add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 1 /f", 0, 1)

为了启用它,重置相同的注册表值:/d 0

详情请见[TweakAndTrick]: Enable Task Manager disabled by Administrator or Virus in Windows

请注意,根据您的用户,可能需要调整一些注册表项权限。