请分析一下这两段vbe代码
发布网友
发布时间:2023-08-27 10:20
我来回答
共1个回答
热心网友
时间:2024-03-07 19:17
if instr(1,id.commandLine,wscript.scriptfullname)<>0 and pipe.count>=2 then
'是否有其他脚本在运行wscript.exe
s.regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr",0,"REG_DWORD" '减禁资源管理器
s.regwrite"HKCU\Software\Policies\Microsoft\Windows\System\DisableCMD",0,"REG_DWORD"
'减禁cmd.exe
id.terminate() '关闭wscript.exe进程
else '只有本脚本运行wscript.exe
s.regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr",1,"REG_DWORD" '禁用资源管理器
s.regwrite"HKCU\Software\Policies\Microsoft\Windows\System\DisableCMD",1,"REG_DWORD"
'禁用cmd
for i=1 to 60 'for循环,这里是倒计时60s
s.popup"系统将在"& 60-i &"秒后关机...",1,"系统提示",4096+48
next
Set colOS = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * FROM Win32_OperatingSystem")
For Each eOs In colOS
eOs.Win32Shutdown(2) '关机命令
Next
end if
Next
和
WSHshellA.run "cmd.exe /c shutdown -r -t 120 -c ""说猪猪猪,不说猪猪猪就俩分钟关你机,不信,试试···"" ",0 ,true 'vbs运行cmd关机命令,-r是重启,-t 120是延时120s
dim a
do while(a <> "猪猪猪") '当a<>"猪猪猪"时无限循环,就是一串整人代码。
a = inputbox ("说猪猪猪,就不关机,快撒,说 ""猪猪猪是头猪"" ","说不说","不说",8000,7000)
'输入3个猪退出循环,否则一直出现。
msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"
loop
msgbox chr(13) + chr(13) + chr(13) + "这是事实啊。早说就行了嘛"
dim WSHshell
set WSHshell = wscript.createobject("wscript.shell")
WSHshell.run "cmd.exe /c shutdown -a",0 ,true '取消关机命令
msgbox chr(1) + chr(13) + chr(13) + "祭天祭地祭猪猪猪"
剩下的都很简单了。如果还有哪些没懂可以追问!