Sign in to follow this  
Followers 0
Doppio

Intel Proset/Wireless

9 posts in this topic

Good Morning.

I'm working on a utility to automate wireless configurations for my clients, but I found out that not all of them have the Intel wireless card.

I found several posts that show how to retrieve the system information, but I can't figure out how to use it in my code!

I have the following vb script that does what I need:

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter",,48)
    For Each objNIC in colItems
        pos3945 = InStr(objNIC.Name,"3945ABG")
        pos2200 = InStr(objNIC.Name,"2200BG")
        if pos3945 <> "0" or pos2200 <> "0" then
            ' \\ If an adapter exists, echo that it exists.
            'wscript.echo "Intel NIC Exists"
            IntelExists = "True"
        end if
    Next

Can someone help me convert this to Autoit?

Thanks in advance.

Share this post


Link to post
Share on other sites



Straight from AutoIt Scriptomatic. Edit those and you should get what you need <_<

; Generated by AutoIt Scriptomatic

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$Output=""
$Output = $Output & "Computer: " & $strComputer  & @CRLF
$Output = $Output & "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
      $Output = $Output & "AdapterType: " & $objItem.AdapterType & @CRLF
      $Output = $Output & "AdapterTypeId: " & $objItem.AdapterTypeId & @CRLF
      $Output = $Output & "AutoSense: " & $objItem.AutoSense & @CRLF
      $Output = $Output & "Availability: " & $objItem.Availability & @CRLF
      $Output = $Output & "Caption: " & $objItem.Caption & @CRLF
      $Output = $Output & "ConfigManagerErrorCode: " & $objItem.ConfigManagerErrorCode & @CRLF
      $Output = $Output & "ConfigManagerUserConfig: " & $objItem.ConfigManagerUserConfig & @CRLF
      $Output = $Output & "CreationClassName: " & $objItem.CreationClassName & @CRLF
      $Output = $Output & "Description: " & $objItem.Description & @CRLF
      $Output = $Output & "DeviceID: " & $objItem.DeviceID & @CRLF
      $Output = $Output & "ErrorCleared: " & $objItem.ErrorCleared & @CRLF
      $Output = $Output & "ErrorDescription: " & $objItem.ErrorDescription & @CRLF
      $Output = $Output & "Index: " & $objItem.Index & @CRLF
      $Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
      $Output = $Output & "Installed: " & $objItem.Installed & @CRLF
      $Output = $Output & "LastErrorCode: " & $objItem.LastErrorCode & @CRLF
      $Output = $Output & "MACAddress: " & $objItem.MACAddress & @CRLF
      $Output = $Output & "Manufacturer: " & $objItem.Manufacturer & @CRLF
      $Output = $Output & "MaxNumberControlled: " & $objItem.MaxNumberControlled & @CRLF
      $Output = $Output & "MaxSpeed: " & $objItem.MaxSpeed & @CRLF
      $Output = $Output & "Name: " & $objItem.Name & @CRLF
      $Output = $Output & "NetConnectionID: " & $objItem.NetConnectionID & @CRLF
      $Output = $Output & "NetConnectionStatus: " & $objItem.NetConnectionStatus & @CRLF
      $strNetworkAddresses = $objItem.NetworkAddresses(0)
      $Output = $Output & "NetworkAddresses: " & $strNetworkAddresses & @CRLF
      $Output = $Output & "PermanentAddress: " & $objItem.PermanentAddress & @CRLF
      $Output = $Output & "PNPDeviceID: " & $objItem.PNPDeviceID & @CRLF
      $strPowerManagementCapabilities = $objItem.PowerManagementCapabilities(0)
      $Output = $Output & "PowerManagementCapabilities: " & $strPowerManagementCapabilities & @CRLF
      $Output = $Output & "PowerManagementSupported: " & $objItem.PowerManagementSupported & @CRLF
      $Output = $Output & "ProductName: " & $objItem.ProductName & @CRLF
      $Output = $Output & "ServiceName: " & $objItem.ServiceName & @CRLF
      $Output = $Output & "Speed: " & $objItem.Speed & @CRLF
      $Output = $Output & "Status: " & $objItem.Status & @CRLF
      $Output = $Output & "StatusInfo: " & $objItem.StatusInfo & @CRLF
      $Output = $Output & "SystemCreationClassName: " & $objItem.SystemCreationClassName & @CRLF
      $Output = $Output & "SystemName: " & $objItem.SystemName & @CRLF
      $Output = $Output & "TimeOfLastReset: " & WMIDateStringToDate($objItem.TimeOfLastReset) & @CRLF
      if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
      $Output=""
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_NetworkAdapter" )
Endif


Func WMIDateStringToDate($dtmDate)

    Return (StringMid($dtmDate, 5, 2) & "/" & _
    StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
    & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFuncoÝ÷ Ù«­¢+Øì¹ÉÑäÕѽ%ÐMÉ¥ÁѽµÑ¥((ÀÌØíݵ±IÑÕɹ%µµ¥Ñ±äôÁàÄÀ(ÀÌØíݵ±½ÉÝÉ=¹±äôÁàÈÀ(ÀÌØí½±%ѵÌôÅÕ½ÐìÅÕ½Ðì(ÀÌØíÍÑÉ
½µÁÕÑÈôÅÕ½Ðí±½±¡½ÍÐÅÕ½Ðì((ÀÌØí=ÕÑÁÕÐôÅÕ½ÐìÅÕ½Ðì(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí
½µÁÕÑÈèÅÕ½ÐìµÀìÀÌØíÍÑÉ
½µÁÕÑȵÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐìôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôÅÕ½ÐìµÀì
I1(ÀÌØí½©]5%MÉÙ¥ô=©Ð ÅÕ½ÐíÝ¥¹µµÑÌèÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØíÍÑÉ
½µÁÕÑȵÀìÅÕ½ÐìÀäÈíɽ½ÐÀäÈí
%5XÈÅÕ½Ðì¤(ÀÌØí½±%ѵÌôÀÌØí½©]5%MÉÙ¥¹áEÕÉä ÅÕ½ÐíM1
P¨I=4]¥¸ÌÉ}9ÑݽɭÁÑÉ
½¹¥ÕÉÑ¥½¸ÅÕ½Ðì°ÅÕ½Ðí]E0ÅÕ½Ðì°|(ÀÌØíݵ±IÑÕɹ%µµ¥Ñ±ä¬ÀÌØíݵ±½ÉÝÉ=¹±ä¤()%%Í=¨ ÀÌØí½±%ѵ̤ѡ¸(½ÈÀÌØí½©%Ñ´%¸ÀÌØí½±%ѵÌ(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíÉÁ±ÝåÍM½ÕÉI½ÕÑèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹ÉÁ±ÝåÍM½ÕÉI½ÕѵÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíÉÁUÍÑ¡ÉM9@èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹ÉÁUÍÑ¡ÉM9@µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí
ÁÑ¥½¸èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹
ÁÑ¥½¸µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíÑÍAÑ èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹ÑÍAÑ µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí]Ñѹ±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹]Ñѹ±µÀì
I1(ÀÌØíÍÑÉÕ±Ñ%AÑÝäôÀÌØí½©%Ñ´¹Õ±Ñ%AÑÝä À¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíÕ±Ñ%AÑÝäèÅÕ½ÐìµÀìÀÌØíÍÑÉÕ±Ñ%AÑÝäµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíÕ±ÑQ=LèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹Õ±ÑQ=LµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíÕ±ÑQQ0èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹Õ±ÑQQ0µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíÍÉ¥ÁÑ¥½¸èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹ÍÉ¥ÁÑ¥½¸µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí!
A¹±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹!
A¹±µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí!
A1ÍáÁ¥ÉÌèÅÕ½ÐìµÀì]5%ÑMÑÉ¥¹Q½Ñ ÀÌØí½©%Ñ´¹!
A1ÍáÁ¥É̤µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí!
A1Í=Ñ¥¹èÅÕ½ÐìµÀì]5%ÑMÑÉ¥¹Q½Ñ ÀÌØí½©%Ñ´¹!
A1Í=Ñ¥¹¤µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí!
AMÉÙÈèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹!
AMÉÙȵÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí9M½µ¥¸èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹9M½µ¥¸µÀì
I1(ÀÌØíÍÑÉ9M½µ¥¹MÕ¥áMÉ¡=ÉÈôÀÌØí½©%Ñ´¹9M½µ¥¹MÕ¥áMÉ¡=ÉÈ À¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí9M½µ¥¹MÕ¥áMÉ¡=ÉÈèÅÕ½ÐìµÀìÀÌØíÍÑÉ9M½µ¥¹MÕ¥áMÉ¡=ÉȵÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí9M¹±½É]%9MIͽ±ÕÑ¥½¸èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹9M¹±½É]%9MIͽ±ÕÑ¥½¸µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí9M!½ÍÑ9µèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹9M!½ÍÑ9µµÀì
I1(ÀÌØíÍÑÉ9MMÉÙÉMÉ¡=ÉÈôÀÌØí½©%Ñ´¹9MMÉÙÉMÉ¡=ÉÈ À¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí9MMÉÙÉMÉ¡=ÉÈèÅÕ½ÐìµÀìÀÌØíÍÑÉ9MMÉÙÉMÉ¡=ÉȵÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí½µ¥¹9MI¥ÍÑÉÑ¥½¹¹±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹½µ¥¹9MI¥ÍÑÉÑ¥½¹¹±µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí½ÉÝÉ ÕÉ5µ½ÉäèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹½ÉÝÉ  ÕÉ5µ½ÉäµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíÕ±±9MI¥ÍÑÉÑ¥½¹¹±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹Õ±±9MI¥ÍÑÉÑ¥½¹¹±µÀì
I1(ÀÌØíÍÑÉÑÝå
½ÍÑ5ÑÉ¥ôÀÌØí½©%Ñ´¹ÑÝå
½ÍÑ5ÑÉ¥ À¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíÑÝå
½ÍÑ5ÑÉ¥èÅÕ½ÐìµÀìÀÌØíÍÑÉÑÝå
½ÍÑ5ÑÉ¥µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%5A1Ù°èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%5A1Ù°µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%¹àèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%¹àµÀì
I1(ÀÌØíÍÑÉ%AÉÍÌôÀÌØí½©%Ñ´¹%AÉÍÌ À¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%AÉÍÌèÅÕ½ÐìµÀìÀÌØíÍÑÉ%AÉÍ̵Àì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%A
½¹¹Ñ¥½¹5ÑÉ¥èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%A
½¹¹Ñ¥½¹5ÑÉ¥µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%A¹±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%A¹±µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%A¥±ÑÉMÕÉ¥Ñå¹±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%A¥±ÑÉMÕÉ¥Ñå¹±µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%AA½ÉÑMÕÉ¥Ñå¹±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%AA½ÉÑMÕÉ¥Ñå¹±µÀì
I1(ÀÌØíÍÑÉ%AMAɵ¥Ñ%AAɽѽ½±ÌôÀÌØí½©%Ñ´¹%AMAɵ¥Ñ%AAɽѽ½±Ì À¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%AMAɵ¥Ñ%AAɽѽ½±ÌèÅÕ½ÐìµÀìÀÌØíÍÑÉ%AMAɵ¥Ñ%AAɽѽ½±ÌµÀì
I1(ÀÌØíÍÑÉ%AMAɵ¥ÑQ
AA½ÉÑÌôÀÌØí½©%Ñ´¹%AMAɵ¥ÑQ
AA½ÉÑÌ À¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%AMAɵ¥ÑQ
AA½ÉÑÌèÅÕ½ÐìµÀìÀÌØíÍÑÉ%AMAɵ¥ÑQ
AA½ÉÑ̵Àì
I1(ÀÌØíÍÑÉ%AMAɵ¥ÑUAA½ÉÑÌôÀÌØí½©%Ñ´¹%AMAɵ¥ÑUAA½ÉÑÌ À¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%AMAɵ¥ÑUAA½ÉÑÌèÅÕ½ÐìµÀìÀÌØíÍÑÉ%AMAɵ¥ÑUAA½ÉÑ̵Àì
I1(ÀÌØíÍÑÉ%AMÕ¹ÐôÀÌØí½©%Ñ´¹%AMչРÀ¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%AMÕ¹ÐèÅÕ½ÐìµÀìÀÌØíÍÑÉ%AMչеÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%AUÍiɽ   ɽÍÐèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%AUÍiɽ ɽÍеÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%AaÉÍÌèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%AaÉÍ̵Àì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%Aa¹±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%Aa¹±µÀì
I1(ÀÌØíÍÑÉ%AaɵQåÁôÀÌØí½©%Ñ´¹%AaɵQåÁ À¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%AaɵQåÁèÅÕ½ÐìµÀìÀÌØíÍÑÉ%AaɵQåÁµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%Aa5¥QåÁèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%Aa5¥QåÁµÀì
I1(ÀÌØíÍÑÉ%Aa9Ñݽɭ9ÕµÈôÀÌØí½©%Ñ´¹%Aa9Ñݽɭ9ÕµÈ À¤(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%Aa9Ñݽɭ9ÕµÈèÅÕ½ÐìµÀìÀÌØíÍÑÉ%Aa9Ñݽɭ9յȵÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí%AaY¥ÉÑÕ±9Ñ9ÕµÈèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹%AaY¥ÉÑÕ±9Ñ9յȵÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí-Á±¥Ù%¹ÑÉÙ°èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹-Á±¥Ù%¹ÑÉÙ°µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí-Á±¥ÙQ¥µèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹-Á±¥ÙQ¥µµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí5
ÉÍÌèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹5
ÉÍ̵Àì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí5QTèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹5QTµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí9Õµ½ÉÝÉA­ÑÌèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹9Õµ½ÉÝÉA­Ñ̵Àì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíA5QU !Ñѹ±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹A5QU  !Ñѹ±µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíA5QU¥Í½ÙÉå¹±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹A5QU¥Í½ÙÉå¹±µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíMÉÙ¥9µèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹MÉÙ¥9µµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíMÑÑ¥¹%èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹MÑÑ¥¹%µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíQÁ¥Á9Ñ¥½Í=ÁÑ¥½¹ÌèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹QÁ¥Á9Ñ¥½Í=ÁÑ¥½¹ÌµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíQÁ5á
½¹¹ÑIÑɹ͵¥ÍÍ¥½¹ÌèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹QÁ5á
½¹¹ÑIÑɹ͵¥ÍÍ¥½¹ÌµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíQÁ5áÑIÑɹ͵¥ÍÍ¥½¹ÌèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹QÁ5áÑIÑɹ͵¥ÍÍ¥½¹ÌµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíQÁ9Õµ
½¹¹Ñ¥½¹ÌèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹QÁ9Õµ
½¹¹Ñ¥½¹ÌµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíQÁUÍIÄÄÈÉUɹÑA½¥¹ÑÈèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹QÁUÍIÄÄÈÉUɹÑA½¥¹ÑȵÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíQÁ]¥¹½ÝM¥éèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹QÁ]¥¹½ÝM¥éµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí]%9M¹±15!½ÍÑÍ1½½­ÕÀèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹]%9M¹±15!½ÍÑÍ1½½­ÕÀµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí]%9M!½ÍÑ1½½­ÕÁ¥±èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹]%9M!½ÍÑ1½½­ÕÁ¥±µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí]%9MAÉ¥µÉåMÉÙÈèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹]%9MAÉ¥µÉåMÉÙȵÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí]%9MM½Á%èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹]%9MM½Á%µÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí]%9MM½¹ÉåMÉÙÈèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹]%9MM½¹ÉåMÉÙȵÀì
I1(¥5ͽà Ä°ÅÕ½Ðí]5$=ÕÑÁÕÐÅÕ½Ðì°ÀÌØí=ÕÑÁÕФôÈÑ¡¸á¥Ñ1½½À(ÀÌØí=ÕÑÁÕÐôÅÕ½ÐìÅÕ½Ðì(9áÐ)±Í(5ͽà À°ÅÕ½Ðí]5$=ÕÑÁÕÐÅÕ½Ðì°ÅÕ½Ðí9¼]5$=©Ñ̽չ½È±ÍÌèÅÕ½ÐìµÀìÅÕ½Ðí]¥¸ÌÉ}9ÑݽɭÁÑÉ
½¹¥ÕÉÑ¥½¸ÅÕ½Ðì¤)¹¥(()Õ¹]5%ÑMÑÉ¥¹Q½Ñ ÀÌØíѵѤ((IÑÕɸ¡MÑÉ¥¹5¥ ÀÌØíѵѰ԰ȤµÀìÅÕ½Ðì¼ÅÕ½ÐìµÀì|(MÑÉ¥¹5¥ ÀÌØíѵѰܰȤµÀìÅÕ½Ðì¼ÅÕ½ÐìµÀìMÑÉ¥¹1Ð ÀÌØíѵѰФ|(µÀìÅÕ½ÐìÅÕ½ÐìµÀìMÑÉ¥¹5¥ ÀÌØíѵѰä°È¤µÀìÅÕ½ÐìèÅÕ½ÐìµÀìMÑÉ¥¹5¥ ÀÌØíѵѰÄİȤµÀìÅÕ½ÐìèÅÕ½ÐìµÀìMÑÉ¥¹5¥ ÀÌØíѵѰÄ̰Ȥ¤)¹Õ¹oÝ÷ Ù«­¢+Øì¹ÉÑäÕѽ%ÐMÉ¥ÁѽµÑ¥((ÀÌØíݵ±IÑÕɹ%µµ¥Ñ±äôÁàÄÀ(ÀÌØíݵ±½ÉÝÉ=¹±äôÁàÈÀ(ÀÌØí½±%ѵÌôÅÕ½ÐìÅÕ½Ðì(ÀÌØíÍÑÉ
½µÁÕÑÈôÅÕ½Ðí±½±¡½ÍÐÅÕ½Ðì((ÀÌØí=ÕÑÁÕÐôÅÕ½ÐìÅÕ½Ðì(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí
½µÁÕÑÈèÅÕ½ÐìµÀìÀÌØíÍÑÉ
½µÁÕÑȵÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐìôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôÅÕ½ÐìµÀì
I1(ÀÌØí½©]5%MÉÙ¥ô=©Ð ÅÕ½ÐíÝ¥¹µµÑÌèÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØíÍÑÉ
½µÁÕÑȵÀìÅÕ½ÐìÀäÈíɽ½ÐÀäÈí
%5XÈÅÕ½Ðì¤(ÀÌØí½±%ѵÌôÀÌØí½©]5%MÉÙ¥¹áEÕÉä ÅÕ½ÐíM1
P¨I=4]¥¸ÌÉ}9ÑݽɭÁÑÉMÑÑ¥¹ÅÕ½Ðì°ÅÕ½Ðí]E0ÅÕ½Ðì°|(ÀÌØíݵ±IÑÕɹ%µµ¥Ñ±ä¬ÀÌØíݵ±½ÉÝÉ=¹±ä¤()%%Í=¨ ÀÌØí½±%ѵ̤ѡ¸(½ÈÀÌØí½©%Ñ´%¸ÀÌØí½±%ѵÌ(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½Ðí±µ¹ÐèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹±µ¹ÐµÀì
I1(ÀÌØí=ÕÑÁÕÐôÀÌØí=ÕÑÁÕеÀìÅÕ½ÐíMÑÑ¥¹èÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹MÑÑ¥¹µÀì
I1(¥5ͽà Ä°ÅÕ½Ðí]5$=ÕÑÁÕÐÅÕ½Ðì°ÀÌØí=ÕÑÁÕФôÈÑ¡¸á¥Ñ1½½À(ÀÌØí=ÕÑÁÕÐôÅÕ½ÐìÅÕ½Ðì(9áÐ)±Í(5ͽà À°ÅÕ½Ðí]5$=ÕÑÁÕÐÅÕ½Ðì°ÅÕ½Ðí9¼]5$=©Ñ̽չ½È±ÍÌèÅÕ½ÐìµÀìÅÕ½Ðí]¥¸ÌÉ}9ÑݽɭÁÑÉMÑÑ¥¹ÅÕ½Ðì¤)¹¥

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

I understand and have seen Scriptomatic in action, but how do I return true if the intel card exists?

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter",,48)
    For Each objNIC in colItems
        pos3945 = InStr(objNIC.Name,"3945ABG")
        pos2200 = InStr(objNIC.Name,"2200BG")
        if pos3945 <> "0" or pos2200 <> "0" then
            ' \\ If an adapter exists, echo that it exists.
            'wscript.echo "Intel NIC Exists"
            IntelExists = "True"
        end if
    Next

As you can see in this code if IntelExists = True I can continue executing the script.

Thanks.

Share this post


Link to post
Share on other sites

I understand and have seen Scriptomatic in action, but how do I return true if the intel card exists?

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
     Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter",,48)
     For Each objNIC in colItems
         pos3945 = InStr(objNIC.Name,"3945ABG")
         pos2200 = InStr(objNIC.Name,"2200BG")
         if pos3945 <> "0" or pos2200 <> "0" then
             ' \\ If an adapter exists, echo that it exists.
             'wscript.echo "Intel NIC Exists"
             IntelExists = "True"
         end if
     Next

As you can see in this code if IntelExists = True I can continue executing the script.

Thanks.

Well you run the first code i put on the page? Then at the Intel Card you stop for a moment. You notice that in product name, description, caption and few other places you can see what NIC it is.

; Generated by AutoIt Scriptomatic

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$Output=""
$Output = $Output & "Computer: " & $strComputer  & @CRLF
$Output = $Output & "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
       If StringInStr($objItem.Description, "Intel") Then 
           ; You have found out that the intel card is found
            MsgBox(0,"Test", "Intel card " & $objItem.Description & " was found")
        EndIf
    #cs
      $Output = $Output & "AdapterType: " & $objItem.AdapterType & @CRLF
      $Output = $Output & "AdapterTypeId: " & $objItem.AdapterTypeId & @CRLF
      $Output = $Output & "AutoSense: " & $objItem.AutoSense & @CRLF
      $Output = $Output & "Availability: " & $objItem.Availability & @CRLF
      $Output = $Output & "Caption: " & $objItem.Caption & @CRLF
      $Output = $Output & "ConfigManagerErrorCode: " & $objItem.ConfigManagerErrorCode & @CRLF
      $Output = $Output & "ConfigManagerUserConfig: " & $objItem.ConfigManagerUserConfig & @CRLF
      $Output = $Output & "CreationClassName: " & $objItem.CreationClassName & @CRLF
      $Output = $Output & "Description: " & $objItem.Description & @CRLF
      $Output = $Output & "DeviceID: " & $objItem.DeviceID & @CRLF
      $Output = $Output & "ErrorCleared: " & $objItem.ErrorCleared & @CRLF
      $Output = $Output & "ErrorDescription: " & $objItem.ErrorDescription & @CRLF
      $Output = $Output & "Index: " & $objItem.Index & @CRLF
      $Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
      $Output = $Output & "Installed: " & $objItem.Installed & @CRLF
      $Output = $Output & "LastErrorCode: " & $objItem.LastErrorCode & @CRLF
      $Output = $Output & "MACAddress: " & $objItem.MACAddress & @CRLF
      $Output = $Output & "Manufacturer: " & $objItem.Manufacturer & @CRLF
      $Output = $Output & "MaxNumberControlled: " & $objItem.MaxNumberControlled & @CRLF
      $Output = $Output & "MaxSpeed: " & $objItem.MaxSpeed & @CRLF
      $Output = $Output & "Name: " & $objItem.Name & @CRLF
      $Output = $Output & "NetConnectionID: " & $objItem.NetConnectionID & @CRLF
      $Output = $Output & "NetConnectionStatus: " & $objItem.NetConnectionStatus & @CRLF
      $strNetworkAddresses = $objItem.NetworkAddresses(0)
      $Output = $Output & "NetworkAddresses: " & $strNetworkAddresses & @CRLF
      $Output = $Output & "PermanentAddress: " & $objItem.PermanentAddress & @CRLF
      $Output = $Output & "PNPDeviceID: " & $objItem.PNPDeviceID & @CRLF
      $strPowerManagementCapabilities = $objItem.PowerManagementCapabilities(0)
      $Output = $Output & "PowerManagementCapabilities: " & $strPowerManagementCapabilities & @CRLF
      $Output = $Output & "PowerManagementSupported: " & $objItem.PowerManagementSupported & @CRLF
      $Output = $Output & "ProductName: " & $objItem.ProductName & @CRLF
      $Output = $Output & "ServiceName: " & $objItem.ServiceName & @CRLF
      $Output = $Output & "Speed: " & $objItem.Speed & @CRLF
      $Output = $Output & "Status: " & $objItem.Status & @CRLF
      $Output = $Output & "StatusInfo: " & $objItem.StatusInfo & @CRLF
      $Output = $Output & "SystemCreationClassName: " & $objItem.SystemCreationClassName & @CRLF
      $Output = $Output & "SystemName: " & $objItem.SystemName & @CRLF
      $Output = $Output & "TimeOfLastReset: " & WMIDateStringToDate($objItem.TimeOfLastReset) & @CRLF
    #ce
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_NetworkAdapter" )
Endif


Func WMIDateStringToDate($dtmDate)

    Return (StringMid($dtmDate, 5, 2) & "/" & _
    StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
    & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This is exactly what you need (of course you can clean some of it but i am too lazy to do it for you) <_<

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
       If StringInStr($objItem.Name, "3945ABG") OR StringInStr($objItem.Name, "2200BG") Then
            $IntelExists = "True"
            ExitLoop
        EndIf
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_NetworkAdapter" )
Endif

If $IntelExists = "True" Then
    ; Do Something what you want :) 
EndIf

Edit: Cleaned my code anyway :)

Edited by MadBoy

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Thanks!.

I modified the following, but yours looks much cleaner.

; Generated by AutoIt Scriptomatic

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$Output=""
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM WiFi_AdapterDevice", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
       $pos3945 = StringInstr($objItem.Description,"3945ABG")
       $pos2200 = StringInstr($objItem.Description,"2200BG")
            if $pos3945 <> "0" or $pos2200 <> "0" then
            $IntelExists = "True"
        Else
            $IntelExists = "False"
            endif

$Output = $Output & "Intel Card: " & $IntelExists & @CRLF
      if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
      $Output=""
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "WiFi_AdapterDevice" )
Endif

Share this post


Link to post
Share on other sites

I cleaned mine even more. Check it out.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

My take on it, made into a function and checking for any connection with "Intel" & "Wireless" & "Connection" instead of specific adapter numbers:

If _IntelWirelessExists() Then
    MsgBox(0, "", "Intel Wireless Exists")
Else
    MsgBox(16, "", "NO Intel Wireless")
EndIf


Func _IntelWirelessExists()
    $wbemFlagReturnImmediately = 0x10
    $wbemFlagForwardOnly = 0x20
    $colItems = ""
    $strComputer = "localhost" 
    $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapter", "WQL", _
            $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    If IsObj($colItems) Then
        For $objItem In $colItems
            If StringRegExp($objItem.Description, "(?i).*Intel.*Wireless.*Connection") Then Return True
        Next
        Return False
    Else
        MsgBox(0, "WMI Output", "No WMI Objects Found for class: " & "Win32_NetworkAdapter")
    EndIf
EndFunc   ;==>_IntelWirelessExists

Share this post


Link to post
Share on other sites

Thank you guys!!

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  
Followers 0