Dim WSHShell, r, m, v, t, g
Dim i
On Error Resume Next
Set WSHShell=WScript.CreateObject("WScript.Shell")
v="HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr"
i="REG_DWORD"
t="任务管理器开关"
r=WSHShell.RegRead(v)
g=1
If (r=1) Then g=0
If g=1 Then
WSHShell.RegWrite v,1,i
m=MsgBox("是否限制任务管理器?",3,t)
Else
WSHShell.RegDelete v
m=MsgBox("是否解除任务管理器限制?",3,t)
End If