On Error Resume Next 'The Rnd function returns a random number. The number is always less than 1 but greater or equal to 0. Do RanNum = Int(1000 * Rnd()) 'Return Rundom number 1-1000 OutBox = MsgBox("The random number is: " & RanNum,vbOkcancel,"For next number click OK,for exit Cancel") Loop While OutBox=1 'GFI MAX OutPut If err.number<>0 then WScript.Echo ("Script Check Failed") Wscript.Quit 1001 Else WScript.Echo ("Script Check Passed") Wscript.Quit 0 End If