Dim objWShell Dim stime stime = InputBox("スリープに移行するまでの時間を入力(秒)") If stime = "" Then stime = 0 End If If IsNumeric(stime) And stime > 0 And stime < 10000 Then stime = 1000 * stime Else WScript.Echo "キャンセルします。" WScript.Quit End If WScript.Sleep(stime) Set objWShell = CreateObject("WScript.Shell") objWShell.run "rundll32.exe powrprof.dll,SetSuspendState"