Hi all,
I think I detected a bug in bginfo when saving and loading a more complex user defined wmi query.
My situation:
I am saving my settings in a bgi file, not in the registry
I wanted to shorten the network output of bginfo, so I tried to eliminate some of the interfaces that I am not interested in.
First: the Hyper-V interfaces
That works great with a user defined field (I named it my_networkdescr) and this wmi query
SELECT Description FROM Win32_NetworkAdapter WHERE NetConnectionStatus = 2 AND NOT (Description LIKE 'Hyper-V%')
The result:
- the wmi evaluation within bginfo works well
- the output on the desktop is ok
When I save my config to a bgi file and start bginfo afterwards with this bgi file, everything works as expected.
So far, so good...
Now the problems begins:
I additionally wanted to eliminate the output of the Microsoft loopback interface.
Therefore I extended my user defined field my_networkdescr like this:
SELECT Description FROM Win32_NetworkAdapter WHERE NetConnectionStatus = 2 AND NOT (Description LIKE 'Hyper-V%' OR Description LIKE '%Loopback%')
Now this happens:
When I evaluate the query within bginfo, my query result looks great --> no unwanted Hyper-V Interface and no unwanted loopback interface any more
When I click apply the output on the desktop looks also great
But when I save my bgi file and load it afterwards, stange things happen:
bginfo does not know SOME of my user defined fields any more
My user defined fields that are alphabetically sorted before my_networkdescr are present and ok.
My user defined field my_networkdescr is gone.
All alphabetically subsequent user defined fields are also gone.
Gone means
- they are gone in the "Fields" list at the right border of the bginfo gui
- they are gone on the output on the desktop
When I take a look at the bgi file with notepad++, I can still see text that reminds me of my query my_networkdescr and the subsequent queries.
So my extended query has been saved, maybe not totally correct.
The parser in bginfo seems to load the user defined queries in an alphabetic order.
This works well until my extended my_networkdescr is to be read and interpreted.
This user defined field an all the subsequent fields seem to be ignored.
That means to me:
- Running, saving and loading this user defined field works well:
SELECT Description FROM Win32_NetworkAdapter WHERE NetConnectionStatus = 2 AND NOT (Description LIKE 'Hyper-V%')
2) RUNNING this extended user defined field works well
SELECT Description FROM Win32_NetworkAdapter WHERE NetConnectionStatus = 2 AND NOT (Description LIKE 'Hyper-V%' OR Description LIKE '%Loopback%')
3) Saving and loading this extended user defined field fails
SELECT Description FROM Win32_NetworkAdapter WHERE NetConnectionStatus = 2 AND NOT (Description LIKE 'Hyper-V%' OR Description LIKE '%Loopback%')
Aditionally all alphabetically subsequent user defined fiels are ignored
Is anyone able to verify my investigation and to find a solution for this behaviour?
Thanks a lot!
JV