Jochem Posted August 18, 2011 Posted August 18, 2011 Is there a way to check the state (remote) of a computer in the network. beacuse my script is craching if a computer is in hybernate, while it is reacting on a ping.
JohnOne Posted August 18, 2011 Posted August 18, 2011 Show your code, so people might spot a bug. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Jochem Posted August 18, 2011 Author Posted August 18, 2011 expandcollapse popupFunc _osinfo() _uncheckall() Local $nOSName, $nOSVersion, $nOSServicePack, $nOfficeVersion, $OSs, $BIOS _ExcelSheetActivate($oExceluser, "cad") For $host In $aCompList $cI_CompName = $host Ping($cI_CompName, 20) If @error = 0 Then MsgBox(64, "", $cI_CompName) _GUICtrlStatusBar_SetText($StatusBar1, "checking - osinfo " & $cI_CompName) MsgBox(64, "", "getting computer info") _ComputerGetOSs($OSs) MsgBox(64, "", "array made") If IsArray($OSs) Then MsgBox(64, "", "array is oke") ;~ For $i = 1 To $OSs[0][0] Step 1 ;~ $nOSName = StringSplit($OSs[$i][0], "|") ;~ $nOSName = $nOSName[1] ;~ $nOSName = StringReplace($nOSName, "Microsoft ", "") ;~ $nOSVersion = $OSs[$i][58] ;~ $nOSServicePack = $OSs[$i][47] ;~ If $nOSServicePack > 0 Then ;~ $nOSName = $nOSName & " SP" & $nOSServicePack ;~ Else ;~ $nOSName = $nOSName ;~ EndIf ;~ _ExcelWriteCell($oExceluser, $nOSName, StringTrimLeft($cI_CompName, 4), 5) ;~ _ExcelWriteCell($oExceluser, $nOSVersion, StringTrimLeft($cI_CompName, 4), 6) ;~ _ExcelWriteCell($oExceluser, $OSs[$i][23], StringTrimLeft($cI_CompName, 4), 14) ;~ _ExcelWriteCell($oExceluser, $OSs[$i][46], StringTrimLeft($cI_CompName, 4), 14) ;~ Next EndIf Else ContinueLoop EndIf Next _saveexcel() _statusbaridle() EndFunc ;==>_osinfo the function _ComputerGetOSs($OSs) is from the CompInfo udf that I found here on the forum. it is craching after: MsgBox(64, "", "getting computer info") edit: not only on hybernate, that was coincidence, but always the same computers.....
JohnOne Posted August 18, 2011 Posted August 18, 2011 Have you got link to CompInfo udf? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Jochem Posted August 18, 2011 Author Posted August 18, 2011 Now I see it is craching on 64bit machines: $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
JohnOne Posted August 18, 2011 Posted August 18, 2011 (edited) Easy mistake That function fails for me on quantumlength and quantumtype on 32 bit win 7 But it does say it was developed on win xp sp2 EDIT: And Autoit2 I think Edited August 18, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Jochem Posted August 18, 2011 Author Posted August 18, 2011 thanks for your help anyway. I build a windows version check inside now.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now