Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Strange WMI problem on Intel hardware

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,913 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

Crosspost from here: http://www.autoitscr...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 ERROR
LINE 1165(X:\windows\system32\program.exe)
ERROR: Subscript used w/ non-array variable

I 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
    EndIf
EndIf

The 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 DB75EN
Intel NUC (D33217GKE/DC3217YE)
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg


How to remove advertisement from MSFN

#2
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,584 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
Can you boot two machines, one working and one not working and create two
WMIC Path Win32_ComputerSystem get * /Format:list>good.txt
WMIC Path Win32_ComputerSystem get * /Format:list>bad.txt
and 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? :unsure:

jaclaz

#3
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,913 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

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.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users