Xavia Posted May 15, 2015 Share Posted May 15, 2015 (edited) for example if the driver Intel(R) Technology Access TAP Driver (NDIS 6.30) is there, a message box will prompt that the driver is there, but if its not there the message box will prompt that the driver is not present.I am slowly dying trying to figure this out. *note: this script will be used in different pcs so it may vary if there is a driver or not Edited May 15, 2015 by Xavia Link to comment Share on other sites More sharing options...
water Posted May 15, 2015 Share Posted May 15, 2015 expandcollapse popup; Generated by AutoIt Scriptomatic $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\") $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 & "GUID: " & $objItem.GUID & @CRLF $Output = $Output & "Index: " & $objItem.Index & @CRLF $Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF $Output = $Output & "Installed: " & $objItem.Installed & @CRLF $Output = $Output & "InterfaceIndex: " & $objItem.InterfaceIndex & @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 $Output = $Output & "NetEnabled: " & $objItem.NetEnabled & @CRLF $strNetworkAddresses = $objItem.NetworkAddresses(0) $Output = $Output & "NetworkAddresses: " & $strNetworkAddresses & @CRLF $Output = $Output & "PermanentAddress: " & $objItem.PermanentAddress & @CRLF $Output = $Output & "PhysicalAdapter: " & $objItem.PhysicalAdapter & @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)) EndFuncThis little script (generated by Scriptomatic - which can be found in the Example Scripts forum) generates a list of adapters. Modify this to your needs and check for the required adapter. Xavia 1 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Xavia Posted May 15, 2015 Author Share Posted May 15, 2015 expandcollapsepopupexpandcollapse popup; Generated by AutoIt Scriptomatic $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\") $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 & "GUID: " & $objItem.GUID & @CRLF $Output = $Output & "Index: " & $objItem.Index & @CRLF $Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF $Output = $Output & "Installed: " & $objItem.Installed & @CRLF $Output = $Output & "InterfaceIndex: " & $objItem.InterfaceIndex & @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 $Output = $Output & "NetEnabled: " & $objItem.NetEnabled & @CRLF $strNetworkAddresses = $objItem.NetworkAddresses(0) $Output = $Output & "NetworkAddresses: " & $strNetworkAddresses & @CRLF $Output = $Output & "PermanentAddress: " & $objItem.PermanentAddress & @CRLF $Output = $Output & "PhysicalAdapter: " & $objItem.PhysicalAdapter & @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)) EndFunc This little script (generated by Scriptomatic - which can be found in the Example Scripts forum) generates a list of adapters. Modify this to your needs and check for the required adapter.Thanks Water~ Link to comment Share on other sites More sharing options...
water Posted May 15, 2015 Share Posted May 15, 2015 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
argumentum Posted May 15, 2015 Share Posted May 15, 2015 expandcollapsepopup; Generated by AutoIt Scriptomatic ... $strNetworkAddresses = $objItem.NetworkAddresses(0) .... $strPowerManagementCapabilities = $objItem.PowerManagementCapabilities(0) This little script (generated by Scriptomatic - which can be found in the Example Scripts forum) generates a list of adapters. Modify this to your needs and check for the required adapter.I am fixing up the code of the original scriptomatic and in case of an array, it just shows the first entry. In the original HTA code it uses a function called "_join" that did not get translated to au3. In the updates I've made, I've included this function. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
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