|
|
#1 |
|
Junior Member
Join Date: Jul 2009
Posts: 33
|
WMI via System plugin - query BIOS serial number
The following code demonstrates the usage of the Windows Management Instrumentation (WMI) only via the System plugin.
The sample code displays the BIOS serial number in a message box. I have not yet tried to remotely access computers via this script. Furthermore I left out a call to the CoSetProxyBlanket function because it seems that is is not needed for querying the BIOS serial number. PHP Code:
|
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Feb 2007
Posts: 546
|
Wow, this is a very good example of how to use the System plugin.
Anyhow, you could have used the WMIInspector plugin to get the same result code: |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2009
Posts: 33
|
The WMIInspector plugin is fine as well.
The advantage of the System plugin is that it is shipped with NSIS. Somehow a backslash (\) got lost in the call to IWbemLocator->ConnectServer. It should be: PHP Code:
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jul 2009
Posts: 33
|
The disadvantage of the System plugin is that you need to be very careful with allocating and freeing memory.
So here comes a new version which frees the previously allocated memory for the variant. PHP Code:
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|