alternatif shutdown, restar, log off

Bookmark and Share
Option explicit
Dim angka1,angka2,enter, Operation, hasil,objShell
Set objShell = CreateObject("WScript.Shell")

Operation= Inputbox ("masukan operasi angka- angka,misal      1 = untuk shutdown      2 = untuk restart      3 = untuk stand by      4 = untuk log off      5 = untuk swicth user")

Select Case Operation
Case "1"
msgbox"windows akan di tutup"
Set objShell = CreateObject("WScript.Shell")
WScript.Sleep 500
objShell.SendKeys "^{ESC}"
WScript.Sleep 500
objShell.SendKeys "{UP}"
WScript.Sleep 500 
objShell.SendKeys "{ENTER}"
WScript.Sleep 500 
objShell.SendKeys "{TAB}"
WScript.Sleep 500
objShell.SendKeys "{ENTER}"



Case "2"
msgbox"windows akan di restar"
Set objShell = CreateObject("WScript.Shell")
WScript.Sleep 500
objShell.SendKeys "^{ESC}"
WScript.Sleep 500
objShell.SendKeys "{UP}"
WScript.Sleep 500 
objShell.SendKeys "{ENTER}"
WScript.Sleep 500 
objShell.SendKeys "{TAB}"
WScript.Sleep 500
objShell.SendKeys "{TAB}"
WScript.Sleep 500 
objShell.SendKeys "{ENTER}"

Case "3"
msgbox"windows akan stand by"
Set objShell = CreateObject("WScript.Shell")
WScript.Sleep 500
objShell.SendKeys "^{ESC}"
WScript.Sleep 500
objShell.SendKeys "{UP}"
WScript.Sleep 500 
objShell.SendKeys "{ENTER}"
WScript.Sleep 500   
objShell.SendKeys "{ENTER}"                

Case "4"
msgbox"windows akan log off"
Set objShell = CreateObject("WScript.Shell")
WScript.Sleep 500
objShell.SendKeys "^{ESC}"
WScript.Sleep 500
objShell.SendKeys "{UP}"
WScript.Sleep 500
objShell.SendKeys "{UP}"
WScript.Sleep 500 
objShell.SendKeys "{ENTER}"
WScript.Sleep 500 
objShell.SendKeys "{TAB}"
WScript.Sleep 500
objShell.SendKeys "{ENTER}"        

Case "5"
msgbox"windows akan swicth user"
Set objShell = CreateObject("WScript.Shell")
WScript.Sleep 500
objShell.SendKeys "^{ESC}"
WScript.Sleep 500
objShell.SendKeys "{UP}"
WScript.Sleep 500
objShell.SendKeys "{UP}"
WScript.Sleep 500 
objShell.SendKeys "{ENTER}"
WScript.Sleep 500 
objShell.SendKeys "{ENTER}"

Case Else
Msgbox "tak ada masukan"
msgbox "masukan pilihan 1.2.3.4.5"
End Select

{ 0 komentar... Views All / Send Comment! }

Posting Komentar