Jump to content
Sign in to follow this  
Jochem

check state of computer

Recommended Posts

Jochem

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.

Share this post


Link to post
Share on other sites
Jochem

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

Share this post


Link to post
Share on other sites
Jochem

Share this post


Link to post
Share on other sites
Jochem

Now I see it is craching on 64bit machines:

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

:mellow:

Share this post


Link to post
Share on other sites
JohnOne

:mellow:

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 by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Jochem

thanks for your help anyway.

I build a windows version check inside now.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×