Jump to content
Sign in to follow this  

for $obj in $objlist freezes on some machines (help me troubleshoot?)

Recommended Posts

I have a report from a user that the autoit application works fine when run normally, but when it's invoked as a new process from another program, it freezes:

Func GetStuff()
    Local $wbemFlagReturnImmediately = 0x10
    Local $wbemFlagForwardOnly = 0x20
    Local $colItems = "", $key='', $seed, $objItem, $i, $drives
    Local $objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
    If IsObj($objWMIService) Then
        $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
        If IsObj($colItems) then
           For $objItem In $colItems               <<<<<<<--------------Script freezes on this line the first time, every time.
               If StringLen($objItem.MACAddress) > 0 Then

I'm stumped, can't reproduce it in windows 2000. He runs XP, SP2. script compiled with

any help is appreciated.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...