轉載:http://blog.csdn.net/cosmoslife/article/details/8226500編程
1. 開始-運行-輸入:wbemtest 回車
2. 單擊"鏈接", 輸入:root\cimv2 回車; 或者ROOT\SecurityCenter
3. 單擊"查詢", 輸入:
SELECT * FROM Win32_Process 應用; 或者SELECT * FROM AntiVirusProduct
//程序:
SELECT * FROM Win32_Product;編程語言
//進程PID
SELECT * FROM Win32_Process;ide
//BIOS信息
SELECT * FROM Win32_ComputerSystemProduct;工具
//磁盤列表
SELECT * FROM Win32_LogicalDisk;測試
//主板信息
Select * from Win32_BaseBoard;this
//光驅
Select * from Win32_CDROMDrive;操作系統
//BIOS
Select * from Win32_BIOS;.net
//操做系統
SELECT * FROM Win32_OperatingSystem;code
//服務列表
SELECT * FROM Win32_Service;orm
//內存
Select * from Win32_PhysicalMemory;
//鍵盤信息
Select * from Win32_Keyboard;
//Modem
Select * from Win32_POTSModem;
類名列表
Win32_UserAccount
Win32_GroupUser
Win32_Share
Win32_NTLogEvent
Win32_DiskPartition
Win32_ComputerSystem
http://blog.csdn.net/zhoufoxcn/article/details/4272209?%3E
此工具原文做者已部分漢化,可在原文中查找下載鏈接
說明:WMI Code Creator是微軟提供的一個WMI代碼生成工具,這個工具是微軟在2005年5月提供的,微軟對這個軟件提供的說明以下:
This code is not supported under any Microsoft standard support program or service.
This code is provided AS IS without warranty of any kind. Microsoft further
disclaims all implied warranties including, without limitation, any implied warranties
of merchantability or of fitness for a particular purpose. The entire risk arising out
of the use or performance of this code and documentation remains with you.
In no event shall Microsoft, its authors, or anyone else involved in the creation,
production, or delivery of the code be liable for any damages whatsoever (including,
without limitation, damages for loss of business profits, business interruption,
loss of business information, or other pecuniary loss) arising out of the use of or
inability to use the code or documentation, even if Microsoft has been
advised of the possibility of such damages.
微軟不對這些代碼提供任何支持,也不對使用這個軟件形成的任何損失承擔責任。最近很多朋友在個人博客上留言但願我對早期寫的WMI系列文章做進一步的闡述,因爲近段時間身體(胃病須要接受兩月的治療)和工做的緣由,沒法知足這部分朋友的要求,無心中發現了早期的這個軟件,而且當時我嘗試着將其漢化了。
關於WMI的介紹和WQL查詢語言能夠參考本人早期的相關文章,連接以下:
.net中的WMI編程(一):WMI介紹及簡單應用:
http://blog.csdn.net/zhoufoxcn/archive/2008/01/14/2042697.aspx
.net中的WMI編程(二):WMI中的WQL語言和WQL的測試工具:
http://blog.csdn.net/zhoufoxcn/archive/2008/01/14/2044246.aspx
這篇文章主要是介紹WMI Code Creator的用法的。首先說明這個軟件是在.net Framework 2.0下編譯的,因此在運行軟件是須要.net Framework 2.0支持。
WMI代碼生成器的界面以下:
利用WMI代碼生成器能夠執行查詢或者執行一個方法等,還能夠查看當前或者遠程電腦上的命名空間以及其下的類,而且還能夠生成相關的代碼(否則就不叫WMI代碼生成器了),支持生成的代碼類型包括VBS、C#及VB.NET,默認生成的代碼是VBS。
例如要想查詢BIOS的相關信息,能夠在命名空間處選擇root/CIMV2(這個是默認選擇),而後在所有類處選擇Win32_BIOS,這時就會列出Win32_BIOS類的全部屬性,能夠選擇其中一個屬性而後點擊「查詢屬性值」,就會在下面的文本框中列出該屬性的值,以下圖所示:
從上圖中能夠看出本人的本本BIOS是DELL的,在右側生成代碼處能夠看到相關的VBS代碼,若是看默認生成的VBS代碼不爽能夠換成C#或者VB.NET的,具體操做就是在「編程語言」菜單處選擇,以下圖所示:
下面是選擇目標編程語言爲C#後生成的代碼,以下圖所示:
WMI代碼生成器默認是鏈接到本地機器,不過也提供了鏈接遠程主機或者主機組的功能,這個能夠在目標機器中選擇。以下圖所示。