Code:
Option Explicit
Dim strOraFine
Dim strPausa
Dim strAzione
Dim objWshShell
strOraFine = InputBox("Quando deve essere eseguita l'azione (HH:MM:SS)?")
If strOraFine = "" Then
MsgBox "Per favore digitare l'ora in cui deve essere eseguita l'azione!"
Wscript.Quit
Else
If (Len(strOraFine)<>8) Or (Mid(strOraFine,3,1) <> ":") Or (Mid(strOraFine,6,1) <> ":") Then
MsgBox "Per favore utilizzare il formato indicato per l'inserimento dei dati!"
Wscript.Quit
End If
End If
strAzione = "shutdown.exe"
If MsgBox("Spegnere il computer alle ore ("& strOraFine &") ?", vbYesNo,"Domanda")=vbYes Then
strAzione = strAzione & " /s /f"
MsgBox "Alle " & strOraFine & " il computer verrà spento!"
Else
strAzione = strAzione & " /l /f"
MsgBox "Alle " & strOraFine & " eseguire la disconnessione dell'utente attuale!"
End If
strOraFine = date & " " & strOraFine
strPausa = DateDiff("s", now, strOraFine)
if (strPausa <= 0) then
strOraFine = (date + 1) & " " & strOraFine
strPausa = DateDiff("s", now, strOraFine)
End If
strPausa = strPausa * 1000
WScript.Sleep strPausa
Set objWshShell = CreateObject("WScript.Shell")
objWshShell.Run strAzione
Wscript.Quit
Se vuoi avere il tuo programmino in vbs