**************************************************************************************************************************************************************
linux下wmic命令
wmic -U win-server%password //192.168.1.201 "Select * from Win32_DiskDrive"
wmic -U win-server%password //192.168.1.201 "Select WorkingSetSize from Win32_Process Where CommandLine like '%agent_v2.exe%'"
// 硬件
Win32_Processor, // CPU 處理器
Win32_PhysicalMemory, // 物理內存條
Win32_Keyboard, // 鍵盤
Win32_PointingDevice, // 點輸入設備,包括鼠標。
Win32_FloppyDrive, // 軟盤驅動器
Win32_DiskDrive, // 硬盤驅動器
Win32_CDROMDrive, // 光盤驅動器
Win32_BaseBoard, // 主板
Win32_BIOS, // BIOS 芯片
Win32_ParallelPort, // 並口
Win32_SerialPort, // 串口
Win32_SerialPortConfiguration, // 串口配置
Win32_SoundDevice, // 多媒體設置,一般指聲卡。
Win32_SystemSlot, // 主板插槽 (ISA & PCI & AGP)
Win32_USBController, // USB 控制器
Win32_NetworkAdapter, // 網絡適配器
Win32_NetworkAdapterConfiguration, // 網絡適配器設置
Win32_Printer, // 打印機
Win32_PrinterConfiguration, // 打印機設置
Win32_PrintJob, // 打印機任務
Win32_TCPIPPrinterPort, // 打印機端口
Win32_POTSModem, // MODEM
Win32_POTSModemToSerialPort, // MODEM 端口
Win32_DesktopMonitor, // 顯示器
Win32_DisplayConfiguration, // 顯卡
Win32_DisplayControllerConfiguration, // 顯卡設置
Win32_VideoController, // 顯卡細節。
Win32_VideoSettings, // 顯卡支持的顯示模式。
// 操作系統
Win32_TimeZone, // 時區
Win32_SystemDriver, // 驅動程序
Win32_DiskPartition, // 磁盤分區
Win32_LogicalDisk, // 邏輯磁盤
Win32_LogicalDiskToPartition, // 邏輯磁盤所在分區及始末位置。
Win32_LogicalMemoryConfiguration, // 邏輯內存配置
Win32_PageFile, // 系統頁文件信息
Win32_PageFileSetting, // 頁文件設置
Win32_BootConfiguration, // 系統啟動配置
Win32_ComputerSystem, // 計算機信息簡要
Win32_OperatingSystem, // 操作系統信息
Win32_StartupCommand, // 系統自動啟動程序
Win32_Service, // 系統安裝的服務
Win32_Group, // 系統管理組
Win32_GroupUser, // 系統組帳號
Win32_UserAccount, // 用戶帳號
Win32_Process, // 系統進程
Win32_Thread, // 系統線程
Win32_Share, // 共享
Win32_NetworkClient, // 已安裝的網絡客戶端
Win32_NetworkProtocol, // 已安裝的網絡協議
Win32_NTLogEvent //獲取日志信息
"Win32_1394Controller"
"Win32_1394ControllerDevice"
"Win32_Account"
"Win32_AccountSID"
"Win32_ACE"
"Win32_ActionCheck"
"Win32_ActiveRoute"
"Win32_AllocatedResource"
"Win32_ApplicationCommandLine"
"Win32_ApplicationService"
"Win32_AssociatedBattery"
"Win32_AssociatedProcessorMemory"
"Win32_AutochkSetting"
"Win32_BaseBoard"
"Win32_BaseService"
"Win32_Battery"
"Win32_Binary"
"Win32_BindImageAction"
"Win32_BIOS"
"Win32_BootConfiguration"
"Win32_Bus"
"Win32_CacheMemory"
"Win32_CDROMDrive"
"Win32_CheckCheck"
"Win32_CIMLogicalDeviceCIMDataFile"
"Win32_ClassicCOMApplicationClasses"
"Win32_ClassicCOMClass"
"Win32_ClassicCOMClassSetting"
"Win32_ClassicCOMClassSettings"
"Win32_ClassInfoAction"
"Win32_ClientApplicationSetting"
"Win32_CodecFile"
"Win32_CollectionStatistics"
"Win32_COMApplication"
"Win32_COMApplicationClasses"
"Win32_COMApplicationSettings"
"Win32_COMClass"
"Win32_ComClassAutoEmulator"
"Win32_ComClassEmulator"
"Win32_CommandLineAccess"
"Win32_ComponentCategory"
"Win32_ComputerShutdownEvent"
"Win32_ComputerSystem"
"Win32_ComputerSystemEvent"
"Win32_ComputerSystemProcessor"
"Win32_ComputerSystemProduct"
"Win32_ComputerSystemWindowsProductActivationSetting"
"Win32_COMSetting"
"Win32_Condition"
"Win32_ConnectionShare"
"Win32_ControllerHasHub"
"Win32_CreateFolderAction"
"Win32_CurrentProbe"
"Win32_CurrentTime"
"Win32_DCOMApplication"
"Win32_DCOMApplicationAccessAllowedSetting"
"Win32_DCOMApplicationLaunchAllowedSetting"
"Win32_DCOMApplicationSetting"
"Win32_DefragAnalysis"
"Win32_DependentService"
"Win32_Desktop"
"Win32_DesktopMonitor"
"Win32_DeviceBus"
"Win32_DeviceChangeEvent"
"Win32_DeviceMemoryAddress"
"Win32_DeviceSettings"
"Win32_DFSNode"
"Win32_DFSNodeTarget"
"Win32_DFSTarget"
"Win32_Directory" 目錄
"Win32_DirectorySpecification" 目錄說明
"Win32_DiskDrive" 磁盤驅動
"Win32_DiskDrivePhysicalMedia"
"Win32_DiskDriveToDiskPartition"
"Win32_DiskPartition"
"Win32_DiskQuota"
"Win32_DisplayConfiguration"
"Win32_DisplayControllerConfiguration"
"Win32_DMAChannel"
"Win32_DriverForDevice"
"Win32_DriverVXD"
"Win32_DuplicateFileAction"
"Win32_Environment"
"Win32_EnvironmentSpecification"
"Win32_ExtensionInfoAction"
"Win32_Fan"
"Win32_FileSpecification"
"Win32_FloppyController"
"Win32_FloppyDrive"
"Win32_FontInfoAction"
"Win32_Group"
"Win32_GroupInDomain"
"Win32_GroupUser"
"Win32_HeatPipe"
"Win32_IDEController"
"Win32_IDEControllerDevice"
"Win32_ImplementedCategory"
"Win32_InfraredDevice"
"Win32_IniFileSpecification"
"Win32_InstalledSoftwareElement"
"Win32_IP4PersistedRouteTable"
"Win32_IP4RouteTable"
"Win32_IP4RouteTableEvent"
"Win32_IRQResource"
"Win32_JobObjectStatus"
"Win32_Keyboard"
"Win32_LaunchCondition"
"Win32_LoadOrderGroup"
"Win32_LoadOrderGroupServiceDependencies"
"Win32_LoadOrderGroupServiceMembers"
"Win32_LocalTime"
"Win32_LoggedOnUser"
"Win32_LogicalDisk"
"Win32_LogicalDiskRootDirectory"
"Win32_LogicalDiskToPartition"
"Win32_LogicalFileAccess"
"Win32_LogicalFileAuditing"
"Win32_LogicalFileGroup"
"Win32_LogicalFileOwner"
"Win32_LogicalFileSecuritySetting"
"Win32_LogicalMemoryConfiguration"
"Win32_LogicalProgramGroup"
"Win32_LogicalProgramGroupDirectory"
"Win32_LogicalProgramGroupItem"
"Win32_LogicalProgramGroupItemDataFile"
"Win32_LogicalShareAccess"
"Win32_LogicalShareAuditing"
"Win32_LogicalShareSecuritySetting"
"Win32_LogonSession"
"Win32_LogonSessionMappedDisk"
"Win32_LUID"
"Win32_LUIDandAttributes"
"Win32_ManagedSystemElementResource"
"Win32_MappedLogicalDisk"
"Win32_MemoryArray"
"Win32_MemoryArrayLocation"
"Win32_MemoryDevice"
"Win32_MemoryDeviceArray"
"Win32_MemoryDeviceLocation"
"Win32_MethodParameterClass"
"Win32_MIMEInfoAction"
"Win32_ModuleLoadTrace"
"Win32_ModuleTrace"
"Win32_MotherboardDevice"
"Win32_MountPoint"
"Win32_MoveFileAction"
"Win32_MSIResource"
"Win32_NamedJobObject"
"Win32_NamedJobObjectActgInfo"
"Win32_NamedJobObjectLimit"
"Win32_NamedJobObjectLimitSetting"
"Win32_NamedJobObjectProcess"
"Win32_NamedJobObjectSecLimit"
"Win32_NamedJobObjectSecLimitSetting"
"Win32_NamedJobObjectStatistics"
"Win32_NetworkAdapter"
"Win32_NetworkAdapterConfiguration"
"Win32_NetworkAdapterSetting"
"Win32_NetworkClient"
"Win32_NetworkConnection"
"Win32_NetworkLoginProfile"
"Win32_NetworkProtocol"
"Win32_NTDomain"
"Win32_NTEventlogFile"
"Win32_NTLogEvent"
"Win32_NTLogEventComputer"
"Win32_NTLogEventLog"
"Win32_NTLogEventUser"
"Win32_ODBCAttribute"
"Win32_ODBCDataSourceAttribute"
"Win32_ODBCDataSourceSpecification"
"Win32_ODBCDriverAttribute"
"Win32_ODBCDriverSoftwareElement"
"Win32_ODBCDriverSpecification"
"Win32_ODBCSourceAttribute"
"Win32_ODBCTranslatorSpecification"
"Win32_OnBoardDevice"
"Win32_OperatingSystem"
"Win32_OperatingSystemAutochkSetting"
"Win32_OperatingSystemQFE"
"Win32_OSRecoveryConfiguration"
"Win32_PageFile"
"Win32_PageFileElementSetting"
"Win32_PageFileSetting"
"Win32_PageFileUsage"
"Win32_ParallelPort"
"Win32_Patch"
"Win32_PatchFile"
"Win32_PatchPackage"
"Win32_PCMCIAController"
"Win32_Perf"
"Win32_PerfFormattedData"
"Win32_PerfFormattedData_ASP_ActiveServerPages"
"Win32_PerfFormattedData_ContentFilter_IndexingServiceFilter"
"Win32_PerfFormattedData_ContentIndex_IndexingService"
"Win32_PerfFormattedData_InetInfo_InternetInformationServicesGlobal"
"Win32_PerfFormattedData_ISAPISearch_HttpIndexingService"
"Win32_PerfFormattedData_MSDTC_DistributedTransactionCoordinator"
"Win32_PerfFormattedData_NTFSDRV_SMTPNTFSStoreDriver"
"Win32_PerfFormattedData_PerfDisk_LogicalDisk"
"Win32_PerfFormattedData_PerfDisk_PhysicalDisk"
"Win32_PerfFormattedData_PerfNet_Browser"
"Win32_PerfFormattedData_PerfNet_Redirector"
"Win32_PerfFormattedData_PerfNet_Server"
"Win32_PerfFormattedData_PerfNet_ServerWorkQueues"
"Win32_PerfFormattedData_PerfOS_Cache"
"Win32_PerfFormattedData_PerfOS_Memory"
"Win32_PerfFormattedData_PerfOS_Objects"
"Win32_PerfFormattedData_PerfOS_PagingFile"
"Win32_PerfFormattedData_PerfOS_Processor"
"Win32_PerfFormattedData_PerfOS_System"
"Win32_PerfFormattedData_PerfProc_FullImage_Costly"
"Win32_PerfFormattedData_PerfProc_Image_Costly"
"Win32_PerfFormattedData_PerfProc_JobObject"
"Win32_PerfFormattedData_PerfProc_JobObjectDetails"
"Win32_PerfFormattedData_PerfProc_Process"
"Win32_PerfFormattedData_PerfProc_ProcessAddressSpace_Costly"
"Win32_PerfFormattedData_PerfProc_Thread"
"Win32_PerfFormattedData_PerfProc_ThreadDetails_Costly"
"Win32_PerfFormattedData_PSched_PSchedFlow"
"Win32_PerfFormattedData_PSched_PSchedPipe"
"Win32_PerfFormattedData_RemoteAccess_RASPort"
"Win32_PerfFormattedData_RemoteAccess_RASTotal"
"Win32_PerfFormattedData_RSVP_ACSRSVPInterfaces"
"Win32_PerfFormattedData_RSVP_ACSRSVPService"
"Win32_PerfFormattedData_SMTPSVC_SMTPServer"
"Win32_PerfFormattedData_Spooler_PrintQueue"
"Win32_PerfFormattedData_TapiSrv_Telephony"
"Win32_PerfFormattedData_Tcpip_ICMP"
"Win32_PerfFormattedData_Tcpip_IP"
"Win32_PerfFormattedData_Tcpip_NBTConnection"
"Win32_PerfFormattedData_Tcpip_NetworkInterface"
"Win32_PerfFormattedData_Tcpip_TCP"
"Win32_PerfFormattedData_Tcpip_UDP"
"Win32_PerfFormattedData_TermService_TerminalServices"
"Win32_PerfFormattedData_TermService_TerminalServicesSession"
"Win32_PerfFormattedData_W3SVC_WebService"
"Win32_PerfRawData"
"Win32_PerfRawData_ASP_ActiveServerPages"
"Win32_PerfRawData_ContentFilter_IndexingServiceFilter"
"Win32_PerfRawData_ContentIndex_IndexingService"
"Win32_PerfRawData_InetInfo_InternetInformationServicesGlobal"
"Win32_PerfRawData_ISAPISearch_HttpIndexingService"
"Win32_PerfRawData_MSDTC_DistributedTransactionCoordinator"
"Win32_PerfRawData_NTFSDRV_SMTPNTFSStoreDriver"
"Win32_PerfRawData_PerfDisk_LogicalDisk"
"Win32_PerfRawData_PerfDisk_PhysicalDisk"
"Win32_PerfRawData_PerfNet_Browser"
"Win32_PerfRawData_PerfNet_Redirector"
"Win32_PerfRawData_PerfNet_Server"
"Win32_PerfRawData_PerfNet_ServerWorkQueues"
"Win32_PerfRawData_PerfOS_Cache"
"Win32_PerfRawData_PerfOS_Memory"
"Win32_PerfRawData_PerfOS_Objects"
"Win32_PerfRawData_PerfOS_PagingFile"
"Win32_PerfRawData_PerfOS_Processor"
"Win32_PerfRawData_PerfOS_System"
"Win32_PerfRawData_PerfProc_FullImage_Costly"
"Win32_PerfRawData_PerfProc_Image_Costly"
"Win32_PerfRawData_PerfProc_JobObject"
"Win32_PerfRawData_PerfProc_JobObjectDetails"
"Win32_PerfRawData_PerfProc_Process"
"Win32_PerfRawData_PerfProc_ProcessAddressSpace_Costly"
"Win32_PerfRawData_PerfProc_Thread"
"Win32_PerfRawData_PerfProc_ThreadDetails_Costly"
"Win32_PerfRawData_PSched_PSchedFlow"
"Win32_PerfRawData_PSched_PSchedPipe"
"Win32_PerfRawData_RemoteAccess_RASPort"
"Win32_PerfRawData_RemoteAccess_RASTotal"
"Win32_PerfRawData_RSVP_ACSRSVPInterfaces"
"Win32_PerfRawData_RSVP_ACSRSVPService"
"Win32_PerfRawData_SMTPSVC_SMTPServer"
"Win32_PerfRawData_Spooler_PrintQueue"
"Win32_PerfRawData_TapiSrv_Telephony"
"Win32_PerfRawData_Tcpip_ICMP"
"Win32_PerfRawData_Tcpip_IP"
"Win32_PerfRawData_Tcpip_NBTConnection"
"Win32_PerfRawData_Tcpip_NetworkInterface"
"Win32_PerfRawData_Tcpip_TCP"
"Win32_PerfRawData_Tcpip_UDP"
"Win32_PerfRawData_TermService_TerminalServices"
"Win32_PerfRawData_TermService_TerminalServicesSession"
"Win32_PerfRawData_W3SVC_WebService"
"Win32_PhysicalMedia"
"Win32_PhysicalMemory"
"Win32_PhysicalMemoryArray"
"Win32_PhysicalMemoryLocation"
"Win32_PingStatus"
"Win32_PnPAllocatedResource"
"Win32_PnPDevice"
"Win32_PnPEntity"
"Win32_PnPSignedDriver"
"Win32_PnPSignedDriverCIMDataFile"
"Win32_PointingDevice"
"Win32_PortableBattery"
"Win32_PortConnector"
"Win32_PortResource"
"Win32_POTSModem"
"Win32_POTSModemToSerialPort"
"Win32_PowerManagementEvent"
"Win32_Printer"
"Win32_PrinterConfiguration"
"Win32_PrinterController"
"Win32_PrinterDriver"
"Win32_PrinterDriverDll"
"Win32_PrinterSetting"
"Win32_PrinterShare"
"Win32_PrintJob"
"Win32_PrivilegesStatus"
"Win32_Process"
"Win32_Processor"
"Win32_ProcessStartTrace"
"Win32_ProcessStartup"
"Win32_ProcessStopTrace"
"Win32_ProcessTrace"
"Win32_Product"
"Win32_ProductCheck"
"Win32_ProductResource"
"Win32_ProductSoftwareFeatures"
"Win32_ProgIDSpecification"
"Win32_ProgramGroup"
"Win32_ProgramGroupContents"
"Win32_ProgramGroupOrItem"
"Win32_Property"
"Win32_ProtocolBinding"
"Win32_Proxy"
"Win32_PublishComponentAction"
"Win32_QuickFixEngineering"
"Win32_QuotaSetting"
"Win32_Refrigeration"
"Win32_Registry"
"Win32_RegistryAction"
"Win32_RemoveFileAction"
"Win32_RemoveIniAction"
"Win32_ReserveCost"
"Win32_ScheduledJob"
"Win32_SCSIController"
"Win32_SCSIControllerDevice"
"Win32_SecurityDescriptor"
"Win32_SecurityDescriptorHelper"
"Win32_SecuritySetting"
"Win32_SecuritySettingAccess"
"Win32_SecuritySettingAuditing"
"Win32_SecuritySettingGroup"
"Win32_SecuritySettingOfLogicalFile"
"Win32_SecuritySettingOfLogicalShare"
"Win32_SecuritySettingOfObject"
"Win32_SecuritySettingOwner"
"Win32_SelfRegModuleAction"
"Win32_SerialPort"
"Win32_SerialPortConfiguration"
"Win32_SerialPortSetting"
"Win32_ServerConnection"
"Win32_ServerFeature"
"Win32_ServerSession"
"Win32_Service"
"Win32_ServiceControl"
"Win32_ServiceSpecification"
"Win32_ServiceSpecificationService"
"Win32_Session"
"Win32_SessionConnection"
"Win32_SessionProcess"
"Win32_SettingCheck"
"Win32_ShadowBy"
"Win32_ShadowContext"
"Win32_ShadowCopy"
"Win32_ShadowDiffVolumeSupport"
"Win32_ShadowFor"
"Win32_ShadowOn"
"Win32_ShadowProvider"
"Win32_ShadowStorage"
"Win32_ShadowVolumeSupport"
"Win32_Share"
"Win32_ShareToDirectory"
"Win32_ShortcutAction"
"Win32_ShortcutFile"
"Win32_ShortcutSAP"
"Win32_SID"
"Win32_SIDandAttributes"
"Win32_SMBIOSMemory"
"Win32_SoftwareElement"
"Win32_SoftwareElementAction"
"Win32_SoftwareElementCheck"
"Win32_SoftwareElementCondition"
"Win32_SoftwareElementResource"
"Win32_SoftwareFeature"
"Win32_SoftwareFeatureAction"
"Win32_SoftwareFeatureCheck"
"Win32_SoftwareFeatureParent"
"Win32_SoftwareFeatureSoftwareElements"
"Win32_SoundDevice"
"Win32_StartupCommand"
"Win32_SubDirectory"
"Win32_SystemAccount"
"Win32_SystemBIOS"
"Win32_SystemBootConfiguration"
"Win32_SystemConfigurationChangeEvent"
"Win32_SystemDesktop"
"Win32_SystemDevices"
"Win32_SystemDriver"
"Win32_SystemDriverPnPEntity"
"Win32_SystemEnclosure"
"Win32_SystemLoadOrderGroups"
"Win32_SystemLogicalMemoryConfiguration"
"Win32_SystemMemoryResource"
"Win32_SystemNetworkConnections"
"Win32_SystemOperatingSystem"
"Win32_SystemPartitions"
"Win32_SystemProcesses"
"Win32_SystemProgramGroups"
"Win32_SystemResources"
"Win32_SystemServices"
"Win32_SystemSetting"
"Win32_SystemSlot"
"Win32_SystemSystemDriver" 驅動
"Win32_SystemTimeZone" 時區
"Win32_SystemTrace"
"Win32_SystemUsers" 用戶
"Win32_TapeDrive"
"Win32_TCPIPPrinterPort"
"Win32_TemperatureProbe"
"Win32_Thread"
"Win32_ThreadStartTrace"
"Win32_ThreadStopTrace"
"Win32_ThreadTrace"
"Win32_TimeZone" 時區
"Win32_TokenGroups"
"Win32_TokenPrivileges"
"Win32_Trustee"
"Win32_TypeLibraryAction"
"Win32_UninterruptiblePowerSupply"
"Win32_USBController"
"Win32_USBControllerDevice"
"Win32_USBHub"
"Win32_UserAccount"
"Win32_UserDesktop"
"Win32_UserInDomain"
"Win32_UTCTime"
"Win32_VideoConfiguration"
"Win32_VideoController"
"Win32_VideoSettings"
"Win32_VoltageProbe"
"Win32_Volume"
"Win32_VolumeChangeEvent"
"Win32_VolumeQuota"
"Win32_VolumeQuotaSetting"
"Win32_VolumeUserQuota"
"Win32_WindowsProductActivation"
"Win32_WMIElementSetting"
"Win32_WMISetting"
******************************************************************************************************************************************************
windows wmic 命令
Windows WMIC命令詳解
【例】將當前系統BIOS,CPU,主板等信息輸出到一個HTML網頁文件,命令如下:
::得到系統信息.bat,運行bat文件即可
::系統信息輸出到HTML文件,查看幫助: wmic /?
::wmic [系統參數名] list [brief|full] /format:hform >|>> [文件名]
wmic bios list brief /format:hform > PCinfo.html
wmic baseboard list brief /format:hform >>PCinfo.html
wmic cpu list full /format:hform >>PCinfo.html
wmic os list full /format:hform >>PCinfo.html
wmic computersystem list brief /format:hform >>PCinfo.html
wmic diskdrive list full /format:hform >>PCinfo.html
wmic memlogical list full /format:hform >>PCinfo.html
PCinfo.html
WMIC命令參數幫助參考:
語法:
wmic+全局開關+別名+wql語句+動詞+副詞(或者說是動詞的參數)+動詞開關”
全局開關:
/NAMESPACE 別名使用的名稱空間路徑。
/ROLE 包含此別名定義的角色路徑。
/NODE 別名使用的服務器。
/IMPLEVEL 客戶模擬級別。
/AUTHLEVEL 客戶身份驗證級別。
/LOCALE 客戶應用的語言識別符。
/PRIVILEGES 啟用或禁用所有特權。
/TRACE 將調試信息輸出到 stderr。
/RECORD 將所有輸入命令和輸出寫入日志。
/INTERACTIVE 設置或重設交互模式。
/FAILFAST 設置或重置 FailFast 模式。
/USER 會話期間使用的用戶。
/PASSWORD 用於會話登錄的密碼。
/OUTPUT 為輸出重新定向指定模式。
/APPEND 為輸出重新定向指定模式。
/AGGREGATE 設置或重置集合模式。
/AUTHORITY Specifies the <authority type> for the connection.
/?[:<BRIEF|FULL>] Usage information.
/?[:<BRIEF|FULL>] 用法信息。</P><P>有關具體全局開關的信息,請輸入: switch-name /?</P><P>
別名:
ALIAS - 訪問本地機器上的別名
BASEBOARD - 基板 (也叫母板或系統板) 管理。
BIOS - 基本輸入/輸出服務 (BIOS) 管理。
BOOTCONFIG - 啟動配置管理。
CDROM - CD-ROM 管理。
COMPUTERSYSTEM - 計算機系統管理。
CPU - CPU 管理。
CSPRODUCT - SMBIOS 的計算機系統產品信息。
DATAFILE - DataFile 管理。
DCOMAPP - DCOM 程序管理。
DESKTOP - 用戶桌面管理。
DESKTOPMONITOR - 監視器管理。
DEVICEMEMORYADDRESS - 設備內存地址管理。
DISKDRIVE - 物理磁盤驅動器管理。
DISKQUOTA - NTFS 卷磁盤空間使用情況。
DMACHANNEL - 直接內存訪問(DMA)頻道管理。
ENVIRONMENT - 系統環境設置管理。
FSDIR - 文件目錄系統項目管理。
GROUP - 組帳戶管理。
IDECONTROLLER - IDE 控制器管理。
IRQ - 間隔請求線 (IRQ) 管理。
JOB - 提供對使用計划服務安排的工作的訪問。
LOADORDER - 定義執行依存的系統服務管理。
LOGICALDISK - 本地儲存設備管理。(結果:5-光驅、2-移動磁盤、3-本地硬盤分區)
LOGON - 登錄會話。
MEMCACHE - 緩存內存管理。
MEMLOGICAL - 系統內存管理 (配置布局和內存可用性)。
MEMPHYSICAL - 計算機系統物理內存管理。
NETCLIENT - 網絡客戶端管理。
NETLOGIN - (某一用戶的)網絡登錄信息管理。
NETPROTOCOL - 協議 (和其網絡特點) 管理。
NETUSE - 活動網絡連接管理。
NIC - 網絡界面控制器 (NIC) 管理。
NICCONFIG - 網絡適配器管理。
NTDOMAIN - NT 域管理。
NTEVENT - NT 事件日志的項目
NTEVENTLOG - NT 時間日志文件管理。
ONBOARDDEVICE - 母板(系統板)內置普通設適配器設備的管理。
OS - 已安裝的操作系統管理。
PAGEFILE - 虛擬內存文件對調管理。
PAGEFILESET - 頁面文件設置管理。
PARTITION - 物理磁盤分區區域的管理。
PORT - I/O 端口管理。
PORTCONNECTOR - 物理連接端口管理。
PRINTER - 打印機設備管理。
PRINTERCONFIG - 打印機設備配置管理。
PRINTJOB - 打印工作管理。
PROCESS - 進程管理。
PRODUCT - 安裝包任務管理。
QFE - 快速故障排除。
QUOTASETTING - 設置卷的磁盤配額信息。
RECOVEROS - 當操作系統失敗時,將從內存收集的信息。
REGISTRY - 計算機系統注冊表管理。
SCSICONTROLLER - SCSI 控制器管理。
SERVER - 服務器信息管理。
SERVICE - 服務程序管理。
SHARE - 共享資源管理。
SOFTWAREELEMENT - 安裝在系統上的軟件產品元素的管理。
SOFTWAREFEATURE - SoftwareElement 的軟件產品組件的管理。
SOUNDDEV - 聲音設備管理。
STARTUP - 用戶登錄到計算機系統時自動運行命令的管理。
SYSACCOUNT - 系統帳戶管理。
SYSDRIVER - 基本服務的系統驅動程序管理。
SYSTEMENCLOSURE - 物理系統封閉管理。
SYSTEMSLOT - 包括端口、插口、附件和主要連接點的物理連接點管理。
TAPEDRIVE - 磁帶驅動器管理。
TEMPERATURE - 溫度感應器的數據管理 (電子溫度表)。
TIMEZONE - 時間區域數據管理。
UPS - 不可中斷的電源供應 (UPS) 管理。
USERACCOUNT - 用戶帳戶管理。
VOLTAGE - 電壓感應器 (電子電量計) 數據管理。
VOLUMEQUOTASETTING - 將某一磁盤卷與磁盤配額設置關聯。
WMISET - WMI 服務操作參數管理
wql語句:
wql語句和我們平常用的注入時的sql語句的語法幾乎是一模一樣,甚至更簡單。
一般是where name="xxx" and 之類的,
不過有時候要把name=“xxx"這樣的格式換成"name='xxx'"或者是where(name='xxx')這樣,
反正正常情況下不行 的話就換個寫法。
動詞:
assoc -文件名擴展關聯
call
CREATE -創建
DELETE -刪除
GET -獲取
LIST -鏈表(決定顯示信息的格式與范圍)
SET -設置
副詞:
brief -只顯示摘要信息
Full -只是一個參數,也是list的缺省參數,表示顯示所有信息
Instance -只顯示對象實例
Status -顯示對象狀態
System -
Writeable -只顯示該對象的可寫入的屬性信息
動詞開關:
format: -格式
實例:
wmic logicaldisk list
wmic logicaldisk list brief
結果:
DeviceID brief FreeSpace ProviderName Size VolumeName
A: 2
C: 3 2925694976 6805409792 WINXP
D: 3 1117487104 1759936512 WORK
E: 5
wmic logicaldisk where "DriveType=3" list brief 或 wmic logicaldisk where(DriveType=3) list brief
結果:
DeviceID DriveType FreeSpace ProviderName Size VolumeName
C: 3 2925686784 6805409792 WINXP
D: 3 1117487104 1759936512 WORK
wmic logicaldisk where "DriveType=3" get DeviceID,Size,FreeSpace,Description,FileSystem
結果:
Description DeviceID FileSystem FreeSpace Size
本地固定磁盤 C: FAT32 2925686784 6805409792
本地固定磁盤 D: FAT 1117487104 1759936512
wmic /output:a.html logicaldisk where "DriveType=3" get DeviceID,Size,FreeSpace,Description,FileSystem
結果:將結果保存到a.html文件中(但是a.htm打開看看后,根本就像一個記事本一樣,沒有任何樣式,看起來也不美觀,我們給它指定一個樣式,
就要用到format這個動 詞開關了)
wmic /output:a.html logicaldisk where "DriveType=3" get DeviceID,Size,FreeSpace,Description,FileSystem /format:htable
結果:這樣一來a.htm里就花花綠綠的用表格顯示我們本地磁盤的信息了。
也許你要問,htable是什么東東,其實這是一個 文件,你想要上邊的a.html什么格式,
就可以在C:\WINDOWS\system32\wbem這里找一個你想要的格式的文件名,
具體有以下一些文 件:
CSV
HFORM
HMOF
HTABLE
HXML
LIST
TABLE
VALUE
htable-sortby
htable-sortby.xsl
texttablewsys
texttablewsys.xsl
wmiclimofformat
wmiclimofformat.xsl
wmiclitableformat
wmiclitableformat.xsl
wmiclitableformatnosys
wmiclitableformatnosys.xsl
wmiclivalueformat
wmiclivalueformat.xsl
wmic /output:a.html logicaldisk where "name='c:'" get DeviceID,Size,FreeSpace,Description,FileSystem /format:htable
或wmic /output:a.html logicaldisk where(name='c:') get DeviceID,Size,FreeSpace,Description,FileSystem /format:htable
結果:只獲取C盤的信息
注意: 我們在DriveType=3的沒有用到單引號是因為3是數字型的,而c:是字符型的所以要用單引 號或雙引號。
不過要注意的是如果在wql語句中用到了and,請用()或者""把語句引起來。
WMIC /node:"192.168.8.100" /user:"administrator" /password:"lcx" /output:a.html logicaldisk where "name='c:'" get DeviceID,Size,FreeSpace,Description,FileSystem /format:htable
結果:對遠程計算機
說明:其中node開關表示對哪台機器進行訪問,user和password當然是遠程機器的用戶名和密碼了
WMIC logicaldisk where "name='c:'" set VolumeName ="lcx"
結果:將C盤的卷標更改
wmic /? 、WMIC logicaldisk /?、WMIC logicaldisk list /?、WMIC logicaldisk set /?
結果:命令使用提示
常用命令:
執行“wmic”命令啟動WMIC命令行環境。這個命令可以在XP或 .NET Server的標准命令行解釋器(cmd.exe)、Telnet會話或“運行”對話框中執行。這些啟動方法可以在本地使用,也可以通過.NET Server終端服務會話使用 ...
執行“wmic”命令啟動WMIC命令行環境。這個命令可以在XP或 .NET Server的標准命令行解釋器(cmd.exe)、Telnet會話或“運行”對話框中執行。這些啟動方法可以在本地使用,也可以通過.NET Server終端服務會話使用。
第一次執行WMIC命令時,Windows首先要安裝WMIC,然后顯示出WMIC的命令行提示符。在WMIC命令行提示符上,命令以交互的方式執行。
wimic的運行方式可以有兩種法:
1、搞入wimic進入后輸入命令運行,鍵入wimic后出現wmic:root\cli>時你就可以輸入命令了,如輸入process顯示所有的進程。不知道有什么命令時可以輸入用/?來顯示幫助。exit 是退出交互模式。具體幫助用法如下:
命令行幫助
命令 例子 說明
/? 或 -? 顯示所有全局開關和別名的語法
/ /? /user /? 顯示指定全局開關的信息
/? class /? 顯示某個命令的信息
/? memcache /? 顯示某個別名的信息
/? temperature get /? 顯示別名與動詞組合的信息
/?:Full irq get /?:Full 顯示動詞的幫助信息
如:我要查看process命令的幫助,鍵入:process/?后顯示如下:
wmic:root\cli>process /?
PROCESS - 進程管理。
提示: BNF 的別名用法。
(<alias> [WMIObject] | <alias> [<path where>] | [<alias>] <path where>) [<verb clause>].
用法:
PROCESS ASSOC [<format specifier>]
PROCESS CALL <method name> [<actual param list>]
PROCESS CREATE <assign list>
PROCESS DELETE
PROCESS GET [<property list>] [<get switches>]
PROCESS LIST [<list format>] [<list switches>]
2、用wimic 后面直接跟命令運行,如wmic process 就顯示了所有的進程了。這兩種運行方法就是:交互模式(Interactive mode)和非交互模式(Non-Interactive mode)
下面我們能過一些實例來說明用法:
=====================================================================
顯示進程的詳細信息
輸入 process where name="maxthon.exe" list full
將顯示出mxathon.exe進程所有的信息如下:
CommandLine="D:\mytools\Maxthon2\Maxthon.exe"
CSName=CHINA-46B1E8590
Description=Maxthon.exe
ExecutablePath=D:\mytools\Maxthon2\Maxthon.exe
ExecutionState=
Handle=684
HandleCount=2296
InstallDate=
KernelModeTime=3495000000
MaximumWorkingSetSize=1413120
MinimumWorkingSetSize=204800
Name=Maxthon.exe
OSName=Microsoft Windows XP Professional|C:\WINDOWS|
OtherOperationCount=307814
OtherTransferCount=60877207
PageFaults=1367971
PageFileUsage=89849856
ParentProcessId=1924
PeakPageFileUsage=90091520
PeakVirtualSize=385802240
PeakWorkingSetSize=94031872
Priority=8
PrivatePageCount=89849856
ProcessId=684
QuotaNonPagedPoolUsage=43496
QuotaPagedPoolUsage=257628
QuotaPeakNonPagedPoolUsage=72836
QuotaPeakPagedPoolUsage=271372
ReadOperationCount=85656
ReadTransferCount=121015982
SessionId=0
Status=
TerminationDate=
ThreadCount=57
UserModeTime=1778750000
VirtualSize=353206272
WindowsVersion=5.1.2600
WorkingSetSize=93716480
WriteOperationCount=30940
WriteTransferCount=24169673
******************************************************************************
停止、暫停和運行服務功能
啟動服務startservice,
停止服務stopservice,
暫停服務pauseservice
Service where caption="windows time" call stopservice ------停止服務
Service where caption="windows time" call startservice ------啟動服務
Service where name="w32time" call stopservice ------停止服務,注意name和caption的區別。
caption 顯示服務名name服務名稱,如: telnet服務的顯示名稱是telnet 服務名稱是tlntsvr,還有Windows Time服務的名稱是w32time 顯示名稱是"Windows Time"要用引號引起來,主要是有一個空格。
好了具體看一下:輸入Service where caption="windows time" call startservice后有一個確認輸入y就可以了,返回ReturnValue = 0;表示成功
wmic:root\cli>Service where caption="windows time" call startservice
執行 (\\CHINA-46B1E8590\ROOT\CIMV2:Win32_Service.Name="W32Time")->startservice()
方法執行成功。
輸出參數:
instance of __PARAMETERS
{
ReturnValue = 0;
};
wmic:root\cli>
================================================================================================
顯示出BIOS信息 wmic bios list full
大家可能注意到了上面命令行中還有兩個參數list和full。list決定顯示的信息格式與范圍,它有Brief、Full、Instance、 Status、System、Writeable等多個參數,full只是它的一個參數,也是list的缺省參數,表示顯示所有的信息。其他幾個參數顧名 思義,如Brief表示只顯示摘要信息,Instance表示只顯示對象實例,Status表示顯示對象狀態,Writeable表示只顯示該對象的可寫 入的屬性信息等。
************************************************************************=====================
停止進程的操作
例如,執行下面的命令將關閉正在運行的QQ.exe:
例1、wmic process where name='QQ.exe' call terminate
命令運行結束后,WMIC命令行提示出如下結果:
C:\>wmic process where name='QQ.exe' call terminate
執行 (\\CHINA-46B1E8590\ROOT\CIMV2:Win32_Process.Handle="728")->terminate()
方法執行成功。
輸出參數:
instance of __PARAMETERS
{
ReturnValue = 0;
};
例2、wmic process where name="qq.exe" delete
命令運行結束后,WMIC命令行提示出如下結果:
C:\>wmic process where name="qq.exe" delete
刪除范例 \\CHINA-46B1E8590\ROOT\CIMV2:Win32_Process.Handle="2820"
范例刪除成功。
======================================================================
列出所有的進程 wmic process
==================================================================
連接遠程電腦
★★連接遠程的電腦,不過好象對要開一些相應的服務
wmic /node:"192.168.203.131" /password:"" /user:"administrator"
BIOS - 基本輸入/輸出服務 (BIOS) 管理
★★查看bios版本型號
wmic bios get Manufacturer,Name
WMIC設置IP地址
★★配置或更新IP地址:
wmic nicconfig where index=0 call enablestatic("192.168.1.5"), ("255.255.255.0") ;index=0說明是配置網絡接口1。
配置網關(默認路由):
wmic nicconfig where index=0 call setgateways("192.168.1.1"),(1)
COMPUTERSYSTEM - 計算機系統管理
★★查看系統啟動選項,boot的內容
wmic COMPUTERSYSTEM get SystemStartupOptions
★★查看工作組/域
wmic computersystem get domain
★★更改計算機名abc為123
wmic computersystem where "name='abc'" call rename 123
★★更改工作組google為MyGroup
wmic computersystem where "name='google'" call joindomainorworkgroup "","","MyGroup",1
CPU - CPU 管理
★★查看cpu型號
wmic cpu get name
DATAFILE - DataFile 管理
★★查找e盤下test目錄(不包括子目錄)下的cc.cmd文件
wmic datafile where "drive='e:' and path='\\test\\' and FileName='cc' and Extension='cmd'" list
★★查找e盤下所有目錄和子目錄下的cc.cmd文件,且文件大小大於1K
wmic datafile where "drive='e:' and FileName='cc' and Extension='cmd' and FileSize>'1000'" list
★★刪除e盤下文件大小大於10M的.cmd文件
wmic datafile where "drive='e:' and Extension='cmd' and FileSize>'10000000'" call delete
★★刪除e盤下test目錄(不包括子目錄)下的非.cmd文件
wmic datafile where "drive='e:' and Extension<>'cmd' and path='test'" call delete
★★復制e盤下test目錄(不包括子目錄)下的cc.cmd文件到e:\,並改名為aa.bat
wmic datafile where "drive='e:' and path='\\test\\' and FileName='cc' and Extension='cmd'" call copy "e:\aa.bat"
★★改名c:\hello.txt為c:\test.txt
wmic datafile "c:\\hello.txt" call rename c:\test.txt
★★查找h盤下目錄含有test,文件名含有perl,后綴為txt的文件
wmic datafile where "drive='h:' and extension='txt' and path like '%\\test\\%' and filename like '%perl%'" get name
DESKTOPMONITOR - 監視器管理
★★獲取屏幕分辨率
wmic DESKTOPMONITOR where Status='ok' get ScreenHeight,ScreenWidth
DISKDRIVE - 物理磁盤驅動器管理
★★獲取物理磁盤型號大小等
wmic DISKDRIVE get Caption,size,InterfaceType
ENVIRONMENT - 系統環境設置管理
★★獲取temp環境變量
wmic ENVIRONMENT where "name='temp'" get UserName,VariableValue
★★更改path環境變量值,新增e:\tools
wmic ENVIRONMENT where "name='path' and username='<system>'" set VariableValue="%path%;e:\tools"
★★新增系統環境變量home,值為%HOMEDRIVE%%HOMEPATH%
wmic ENVIRONMENT create name="home",username="<system>",VariableValue="%HOMEDRIVE%%HOMEPATH%"
★★刪除home環境變量
wmic ENVIRONMENT where "name='home'" delete
FSDIR - 文件目錄系統項目管理
★★查找e盤下名為test的目錄
wmic FSDIR where "drive='e:' and filename='test'" list
★★刪除e:\test目錄下除過目錄abc的所有目錄
wmic FSDIR where "drive='e:' and path='\\test\\' and filename<>'abc'" call delete
★★刪除c:\good文件夾
wmic fsdir "c:\\good" call delete
★★重命名c:\good文件夾為abb
wmic fsdir "c:\\good" rename "c:\abb"
LOGICALDISK - 本地儲存設備管理
★★獲取硬盤系統格式、總大小、可用空間等
wmic LOGICALDISK get name,Description,filesystem,size,freespace
NIC - 網絡界面控制器 (NIC) 管理
OS - 已安裝的操作系統管理
★★設置系統時間
wmic os where(primary=1) call setdatetime 20070731144642.555555+480
PAGEFILESET - 頁面文件設置管理
★★更改當前頁面文件初始大小和最大值
wmic PAGEFILESET set InitialSize="512",MaximumSize="512"
★★頁面文件設置到d:\下,執行下面兩條命令
wmic pagefileset create name='d:\pagefile.sys',initialsize=512,maximumsize=1024
wmic pagefileset where"name='c:\\pagefile.sys'" delete
PROCESS - 進程管理
★★列出進程的核心信息,類似任務管理器
wmic process list brief
★★結束svchost.exe進程,路徑為非C:\WINDOWS\system32\svchost.exe的
wmic process where "name='svchost.exe' and ExecutablePath<>'C:\\WINDOWS\\system32\\svchost.exe'" call Terminate
★★新建notepad進程
wmic process call create notepad
PRODUCT - 安裝包任務管理
★★安裝包在C:\WINDOWS\Installer目錄下
★★卸載.msi安裝包
wmic PRODUCT where "name='Microsoft .NET Framework 1.1' and Version='1.1.4322'" call Uninstall
★★修復.msi安裝包
wmic PRODUCT where "name='Microsoft .NET Framework 1.1' and Version='1.1.4322'" call Reinstall
SERVICE - 服務程序管理
★★運行spooler服務
wmic SERVICE where name="Spooler" call startservice
★★停止spooler服務
wmic SERVICE where name="Spooler" call stopservice
★★暫停spooler服務
wmic SERVICE where name="Spooler" call PauseService
★★更改spooler服務啟動類型[auto|Disabled|Manual] 釋[自動|禁用|手動]
wmic SERVICE where name="Spooler" set StartMode="auto"
★★刪除服務
wmic SERVICE where name="test123" call delete
SHARE - 共享資源管理
★★刪除共享
wmic SHARE where name="e$" call delete
★★添加共享
WMIC SHARE CALL Create "","test","3","TestShareName","","c:\test",0
SOUNDDEV - 聲音設備管理
wmic SOUNDDEV list
STARTUP - 用戶登錄到計算機系統時自動運行命令的管理
★★查看msconfig中的啟動選項
wmic STARTUP list
SYSDRIVER - 基本服務的系統驅動程序管理
wmic SYSDRIVER list
USERACCOUNT - 用戶帳戶管理
★★更改用戶administrator全名為admin
wmic USERACCOUNT where name="Administrator" set FullName="admin"
★★更改用戶名admin為admin00
wmic useraccount where "name='admin" call Rename admin00
================================================獲取補丁信息
★★查看當前系統打了哪些補丁
/node:legacyhost qfe get hotfixid
查看CPU當前的速度
★★cpu當前的速度
wmic cpu get CurrentClockSpeed
遠程計算機的遠程桌面連接
★★WMIC命令開啟遠程計算機的遠程桌面連接
執行wmic /node:192.168.1.2 /USER:administrator
PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSConnections 1
具體格式:
wmic /node:"[full machine name]" /USER:"[domain]\[username]"
PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSConnections 1
wmic 獲取進程名稱以及可執行路徑:
wmic process get name,executablepath
wmic 刪除指定進程(根據進程名稱):
wmic process where name="qq.exe" call terminate
或者用
wmic process where name="qq.exe" delete
wmic 刪除指定進程(根據進程PID):
wmic process where pid="123" delete
wmic 創建新進程
wmic process call create "C:\Program Files\Tencent\QQ\QQ.exe"
在遠程機器上創建新進程:
wmic /node:192.168.201.131 /user:administrator /password:123456 process call create cmd.exe
關閉本地計算機
wmic process call create shutdown.exe
重啟遠程計算機
wmic /node:192.168.1.10/user:administrator /password:123456 process call create "shutdown.exe -r -f -m"
更改計算機名稱
wmic computersystem where "caption='%ComputerName%'" call rename newcomputername
更改帳戶名
wmic USERACCOUNT where "name='%UserName%'" call rename newUserName
wmic 結束可疑進程(根據進程的啟動路徑)
wmic process where "name='explorer.exe' and executablepath<>'%SystemDrive%\\windows\\explorer.exe'" delete
wmic 獲取物理內存
wmic memlogical get TotalPhysicalMemory|find /i /v "t"
wmic 獲取文件的創建、訪問、修改時間
@echo off
for /f "skip=1 tokens=1,3,5 delims=. " %%a in ('wmic datafile where name^="c:\\windows\\system32\\notepad.exe" get CreationDate^,LastAccessed^,LastModified') do (
set a=%%a
set b=%%b
set c=%%c
echo 文件: c:\windows\system32\notepad.exe
echo.
echo 創建時間: %a:~0,4% 年 %a:~4,2% 月 %a:~6,2% 日 %a:~8,2% 時 %a:~10,2% 分 %a:~12,2% 秒
echo 最后訪問: %b:~0,4% 年 %b:~4,2% 月 %b:~6,2% 日 %b:~8,2% 時 %b:~10,2% 分 %b:~12,2% 秒
echo 最后修改: %c:~0,4% 年 %c:~4,2% 月 %c:~6,2% 日 %c:~8,2% 時 %c:~10,2% 分 %c:~12,2% 秒
)
echo.
pause
wmic 全盤搜索某文件並獲取該文件所在目錄
for /f "skip=1 tokens=1*" %i in ('wmic datafile where "FileName='qq' and extension='exe'" get drive^,path') do (set "qPath=%i%j"&@echo %qPath:~0,-3%)
獲取屏幕分辨率 wmic DESKTOPMONITOR where Status='ok' get ScreenHeight,ScreenWidth
wmic PageFileSet set InitialSize="512",MaximumSize="512"
設置虛擬內存到E盤,並刪除C盤下的頁面文件,重啟計算機后生效
wmic PageFileSet create name="E:\\pagefile.sys",InitialSize="1024",MaximumSize="1024"
wmic PageFileSet where "name='C:\\pagefile.sys'" delete
獲得進程當前占用的內存和最大占用內存的大小:
wmic process where caption='filename.exe' get WorkingSetSize,PeakWorkingSetSize
以KB為單位顯示
@echo off
for /f "skip=1 tokens=1-2 delims= " %%a in ('wmic process where caption^="conime.exe" get WorkingSetSize^,PeakWorkingSetSize') do (
set /a m=%%a/1024
set /a mm=%%b/1024
echo 進程conime.exe現在占用內存:%m%K;最高占用內存:%mm%K
)
pause
遠程打開計算機遠程桌面
wmic /node:%pcname% /USER:%pcaccount% PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSConnections 1
===========================================================================
批處理的api--WMIC學習體會
在這篇文章里也許你看不到很多奇特有用的的實際例程,但是呢,授人以魚不如授人以漁,希望我的文章能讓你通俗易懂的了解一些wmic的基本知識,可以有一個學習的興趣,讓自己繼續深研一下wmic。
在WINDOWS\Help目下,wmic.chm文檔是這樣解釋wmi的:Windows Management Instrumentation (WMI) 是“基於 Web 的企業管理倡議 (WBEM)”(這是一個旨在建立在企業網絡上訪問和共享管理信息的標准的工業倡議)的 Microsoft 的實現。有關 WBEM 的詳細信息,請訪問 WBEM。XOXWMI 為公用信息模型 (CIM)(該數據模型描述存在於管理環境中的對象)提供完整的支持。WMI 包括對象儲備庫和 CIM 對象管理器,其中對象儲備庫是包含對象定義的數據庫,對象管理器負責處理儲備庫中對象的收集和操作並從 WMI 提供程序 (WMI provider) 收集信息。WMI 提供程序 (WMI provider) 在 WMI 和操作系統、應用程序以及其他系統的組件之間充當中介。例如,注冊表提供程序從注冊表中提供信息,而 SNMP 提供程序則從 SNMP 設備中提供數據和事件。提供程序提供關於其組件的信息,也可能提供一些方法,這些方法可以操作可設置的組件、屬性,或者操作可能警告您在組件中要發生更改 的事件。Windows Management Instrumentation 命令行 (WMIC) 向您提供了簡單的 Windows Management Instrumentation (WMI) 命令行界面,這樣即可利用 WMI 來管理運行 Windows 的計算機。WMIC 與現有命令行程序和實用程序命令相互操作,且很容易通過腳本或其他面向管理的應用程序來擴展 WMIC。
以上的這些說法太專業了,通俗一點講就是wmic.exe是一個命令行程序,可以用它這個接口來實現在命令行下直接管理計算機軟硬件等方方面面的操作,相當於批處理的api了。
wmic是很強大的,像開2003的3389一句話就可以做到:wmic RDTOGGLE WHERE ServerName='%COMPUTERNAME%' call SetAllowTSConnections 1。