WMI / WMIC Scripting Guide
WMIC.EXE
Note that it may be best to look at these commands from this Text link.
wmic /output:C:\Dsk.csv /namespace:\\root\cimv2 path Win32_LogicalDisk get FileSystem, FreeSpace, Size, VolumeSerialNumber, VolumeName, caption, description /format:csv.xsl
Example#1 Cpu statistics
wmic /output:C:\Proc.htm CPU get Description, DeviceID, Manufacturer, MaxClockSpeed, Name, Status, SystemName /format:hform.xsl
Node: XP-01 - 1 Instances of Win32_Processor
| Intel(R) Pentium(R) 4 CPU 2.66GHz | |
| Property Name | Value |
| Description | x86 Family 15 Model 2 Stepping 8 |
| DeviceID | CPU0 |
| Manufacturer | GenuineIntel |
| MaxClockSpeed |
2657 |
| Name | Intel(R) Pentium(R) 4 CPU 2.66GHz |
| Status | OK |
| SystemName | XP-01 |
Example#2
wmic /output:C:\Proc.htm CPU get Description, DeviceID, Manufacturer, MaxClockSpeed, Name, Status, SystemName /format:csv.xsl
Node,Description,DeviceID,Manufacturer,MaxClockSpeed,Name,Status,SystemName
XP-01,x86 Family 15 Model 2 Stepping 8,CPU0,GenuineIntel,2657,Intel(R) Pentium(R) 4 CPU 2.66GHz,OK,XP-01
Scripting with WMIC.EXE
Click here to view the output of this script (below)
wmic /output:C:\Inventory.html /namespace:\\root\cimv2 path Win32_LogicalDisk get FileSystem, FreeSpace, Size, VolumeSerialNumber, VolumeName, Caption, description /format:hform.xsl
wmic /append:C:\Inventory.html /namespace:\\root\cimv2 path Win32_ComputerSystem get CurrentTimeZone, Description, Domain, TotalPhysicalMemory, Model, Name, UserName /format:hform.xsl
wmic /append:C:\Inventory.html /namespace:\\root\cimv2 path Win32_BIOS get Name, SMBIOSBIOSVersion, SerialNumber, Version, BuildNumber, Status /format:hform.xsl
wmic /append:C:\Inventory.html /namespace:\\root\cimv2 path Win32_LogicalMemoryConfiguration get AvailableVirtualMemory, Caption, Description, Name, SettingID, TotalPageFileSpace, TotalPhysicalMemory, TotalVirtualMemory /format:hform.xsl
wmic /append:C:\Inventory.html /namespace:\\root\cimv2 path Win32_NetworkAdapter get Caption, DNSDomain, DNSHostName, DefaultIPGateway, Description, IPAddress, IPSubnet, MACAddress, ServiceName, WINSPrimaryServer, WINSSecondaryServer /format:hform.xsl
wmic /append:C:\Inventory.html /namespace:\\root\cimv2 path Win32_Processor get Caption, Description, DeviceID, Manufacturer, MaxClockSpeed, Name, Status, SystemName /format:hform.xsl
