Tripredacus Posted May 14, 2013 Share Posted May 14, 2013 Crosspost from here: http://www.autoitscript.com/forum/topic/150866-strange-wmi-problem-on-intel-hardware/I don't think it is an AutoIT problem.I've been getting reports from manufacturing that some of our applications have been generating an error, such as:AUTOIT ERRORLINE 1165(X:\windows\system32\program.exe)ERROR: Subscript used w/ non-array variableI have determined what is causing this error, and at which point, but not why and have not been able to determine a way to program around it. I am actually seeing this error in any application that reads from the WMI, here is an example script:$sWMIService = "winmgmts:\\" & @ComputerName & "\root\CIMV2"$objWMIService = ObjGet($sWMIService)IF IsObj($objWMIService) Then $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem") If IsObj($colItems) Then For $oItem In $colItems $sModel = StringReplace( $oItem.Model , "/" , "" ) Next EndIfEndIfThe application reads from WMI to get the Model number for 2 reasons. 1 it displays it on the screen and 2 it looks up that value on the server so that it can generate the GUI. Obviously, if the field is empty an error is generated. However, it does not care if it cannot find the value on the server, as if the value does not match, it shows a default message. So the way it is currently written, I know exactly what the error means when it appears. It means the field is empty. There was only 1 hardware I had where the field actually WAS empty, and it was a prototype unit. If a production unit had no value there, we would defect it out for obvious reasons.Now on to where the error occurs. The application is compiled for 64bit.Case where error occurs (not 100% of hardware, but 100% on the hardware it happens on unless workaround.)- Intel BIOS has both UEFI and Legacy Boot enabled.- BIOS-level PXE* boot to WinPE 4.0 x64- Run application- WMI value is an object, but the object is empty, or null.* I don't think PXE is a requirement, but I don't boot via CD or USB.Workaround- Disable UEFI boot in the BIOS.If you can think of any thing I could try to find out what the problem could be, let me know. I may end up posting this question elsewhere as well.For those who are interested, hardware effected:Intel DB75ENIntel NUC (D33217GKE/DC3217YE) Link to comment Share on other sites More sharing options...
jaclaz Posted May 14, 2013 Share Posted May 14, 2013 Can you boot two machines, one working and one not working and create two WMIC Path Win32_ComputerSystem get * /Format:list>good.txtWMIC Path Win32_ComputerSystem get * /Format:list>bad.txtand post them?But what is the actual problem?I mean you can put a check in the Autoit code and if the field comes empty you write *something* to it.Or am I missing something? jaclaz Link to comment Share on other sites More sharing options...
Tripredacus Posted May 14, 2013 Author Share Posted May 14, 2013 The actual problem is that on some of this new hardware, you can't read from WMI. Its not across the board. I am testing on a NUC now and it does not exhibit this problem. I'll keep an eye out for one that gets the error and then run the command you requested.I just got one on the DB75EN. Wmic was able to read that field in the BIOS just fine but.... it has "technically" invalid information. I can't post what shows up, but it isn't the model number. This in itself shouldn't matter with generating the GUI. I think instead I should get a Quad opened with Intel as this might be related. 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