Jump to content

Recommended Posts

Posted

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.

Posted

Func _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.....

Posted

Now I see it is craching on 64bit machines:

$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

:mellow:

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...