GoogleDude Posted September 25, 2008 Share Posted September 25, 2008 I am having a problem altering the below example I found Here. am able to get it to only display the BIOS Manufacture by removing all the extra code. But what I need is to simply display a message and or run a function if if a paticular BIOS Manufacture is detected. I am writing a script that makes changes to the windows registry only on certain motherboards with certain BIOS brands.Can anyone help me set a $var if a particular BIOS is detected?I cant seam to get the formatting correct.here is all I am able to get to run without error. But cant seam to set any $vars if the returned string contains "award" and or "ami"#include "CompInfo.au3" ;If you are wanting to pull WMI data from different computers then Declare $cI_CompName as the computer name before the include. #region -- BIOS Dim $BIOS _ComputerGetBIOS($BIOS) For $i = 1 To $BIOS[0][0] Step 1 MsgBox(0, "Motherboard BIOS Info", "Name: " & $BIOS[$i][0] & @CRLF & _ "Description: " & $BIOS[$i][4] & @CRLF & _ "Manufacturer: " & $BIOS[$i][12]) Next #endregion BIOSAny help please!GoogleDude Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 25, 2008 Share Posted September 25, 2008 Maybe...#include "CompInfo.au3";If you are wanting to pull WMI data from different computers then Declare $cI_CompName as the computer name before the include. #region -- BIOS Dim $BIOS _ComputerGetBIOS($BIOS) For $i = 1 To $BIOS[0][0] If $BIOS[$i][12] = "award" Or "ami" Then $var = $BIOS[$i][12] EndIf Next #endregion BIOS Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
GoogleDude Posted September 25, 2008 Author Share Posted September 25, 2008 Maybe...#include "CompInfo.au3";If you are wanting to pull WMI data from different computers then Declare $cI_CompName as the computer name before the include. #region -- BIOS Dim $BIOS _ComputerGetBIOS($BIOS) For $i = 1 To $BIOS[0][0] If $BIOS[$i][12] = "award" Or "ami" Then $var = $BIOS[$i][12] EndIf Next #endregion BIOS Awesome. That did the trick. Thank you very much. As always the community in this forum has come through for me. Thanks again. GoogleDude Link to comment Share on other sites More sharing options...
GoogleDude Posted September 25, 2008 Author Share Posted September 25, 2008 Crap. I guess the STRING code might be needed. How can I make it so it looks for the word "award" in the $var? I think it is looking for the full result string not just the word "award" in the $var? Thanks again. GoogleDude Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 25, 2008 Share Posted September 25, 2008 Crap. I guess the STRING code might be needed. How can I make it so it looks for the word "award" in the $var? I think it is looking for the full result string not just the word "award" in the $var?"If StringInStr() Then" or "Switch $var/Case"?What's the problem handling the strings? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
GoogleDude Posted September 27, 2008 Author Share Posted September 27, 2008 "If StringInStr() Then" or "Switch $var/Case"? What's the problem handling the strings? Well when I run the below code I get the same results on 2 different PC 1 with an award bios and the other with out an award bios. It says BIOS Not Supported even though I am running it on a PC with an award bios. #include "CompInfo.au3";If you are wanting to pull WMI data from different computers then Declare $cI_CompName as the computer name before the include. Dim $BIOS _ComputerGetBIOS($BIOS) For $i = 1 To $BIOS[0][0] If $BIOS[$i][12] <> String("Award") or $BIOS[$i][4] <> String("Award") or $BIOS[$i][12] <> String("Award") Then MsgBox(1024,"BIOS Not Supported!","Your motherboard BIOS is not Supported.") EndIf If $BIOS[$i][12] = String("Award") or $BIOS[$i][4] = String("Award") or $BIOS[$i][12] = String("Award") Then MsgBox(1024,"BIOS Supported!","Your motherboard BIOS IS Supported.") EndIf Next Thanks for any help. Link to comment Share on other sites More sharing options...
GoogleDude Posted September 27, 2008 Author Share Posted September 27, 2008 I am able to get somewhat accurate results using the below code but it will only be accurate if the BIOS Manufacture Description in WMI Database is "Award Software International, Inc." Would this be an accurate way to do this? Or does anyone know of a better way? Thanks, #include "CompInfo.au3";If you are wanting to pull WMI data from different computers then Declare $cI_CompName as the computer name before the include. Dim $BIOS _ComputerGetBIOS($BIOS) For $i = 1 To $BIOS[0][0] If $BIOS[$i][12] = String("Award Software International, Inc.") Then MsgBox(1024,"BIOS Supported!","Your motherboard BIOS IS Supported.") EndIf If $BIOS[$i][12] <> String("Award Software International, Inc.") Then MsgBox(1024,"BIOS Not Supported!","Your motherboard BIOS is not Supported.") EndIf Next 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