Guest User

Untitled

a guest
May 25th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. Dim ObjShell
  2. Set ObjShell = CreateObject("WScript.Shell")
  3. Dim Input, Hours, Command
  4. Input = InputBox("Enter hours until shutdown", "Info", "1")
  5. If Len(Input) > 0 And IsNumeric(Input) Then
  6. Hours = Input * 3600
  7. Command = "C:\WINDOWS\system32\shutdown.exe /s /f /t " + CStr(Hours)
  8. ObjShell.Run Command
  9. ElseIf Not(IsNumeric(Input)) Then
  10. MsgBox "Input must be a number", vbInformation, "Error"
  11. End If
Add Comment
Please, Sign In to add comment