Set Args = wscript.Arguments RpNum = Args.item(0) Set obj = GetObject("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore") if obj.Restore(RpNum) <> 0 Then wscript.Echo "Restore failed" End If Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true") for each OpSys in OpSysSet OpSys.Reboot() next