Set fso = CreateObject("Scripting.FileSystemObject") Set WSHShell = WScript.CreateObject("WScript.Shell") umschalten(cProgramm) '********************************* sub umschalten(cProgramm) 'Aber zuerst warten wir, bis die Zeit rum ist Dim PC_Time, UserTime, warte UserTime = "23:59:59" 'UserTime = InputBox("Startzeit (Format beibehalten!):","Umschaltplanung V 2.0 by GvD-IT",UserTime) ' Abbruch if UserTime = "" then WScript.Quit end if UserTime = TimeValue(UserTime) PC_Time = TimeValue(Time) Minuten = 5 Minuten = InputBox("+ Minuten nach 0:00 Uhr","PwrDwnSys V 1.0 by GvD-IT",Minuten) warte = 24 * 60 * 60 * (Usertime - PC_Time) + 60 * Minuten 'MsgBox ("usertime: " & UserTime & " PC-Time " & PC_Time & " diff: " & 24 * 60 * 60 * (Usertime - PC_Time)) befehl = "shutdown /s /f /t " & cstr(warte) 'MsgBox ( befehl ) WSHShell.Run befehl end sub