''Show a dialogbox for you to enter the time until the pc will go into standby'' ''----------------------------------------------------------------------------'' TheTimeToWait = InputBox("Type in how many minutes you want to wait before StandBy-Mode is activated!" & vbcrlf & vbcrlf &"or press CANCEL to StandBy within 30 minutes!","Computer StandBy!") 'msgbox TheTimeToWait IF TheTimeToWait = "" THEN ''Sleep for 1800 seconds'' ''----------------------'' WScript.Sleep 1800000 ''Use keystrokes to put the pc into standby-mode'' ''----------------------------------------------'' set WshShell = CreateObject("WScript.Shell") WshShell.SendKeys "^{ESC}dddd{ENTER}v{ENTER}" WScript.Quit ELSE ''Sleep for TheTimeToWait value'' ''-----------------------------'' 'msgbox TheTimeToWait TheTimeToWait = TheTimeToWait * 60 '''translate our number into seconds TheTimeToWait = TheTimeToWait * 1000 '''translate our new number into milliseconds 'msgbox TheTimeToWait WScript.Sleep TheTimeToWait '''milliseconds until we enter sleepmode ''Use keystrokes to put the pc into standby-mode'' ''----------------------------------------------'' set WshShell = CreateObject("WScript.Shell") WshShell.SendKeys "^{ESC}dddd{ENTER}v{ENTER}" WScript.Quit END IF