获取BIOS序列号

  1. wmic bios list full | find "SerialNumber"

SerialNumber=P50168VB

获取CPUID(WIN32_PROCESSOR)

  1. wmic cpu list full | find "ProcessorId"

rem 提取CPU名称和描述的批处理语句

@echo off
for /f "delims=" %%a in ('wmic cpu get name^,description /value^|findstr "="') do set "%%a"
echo;%name%
echo;%description%

ProcessorId=BFEBFBFF000306B9

获取DMI的UUID(WIN32_COMPUTERSYSTEMPRODUCT)

  1. wmic CSPRODUCT list full | find "UUID"

UUID=8FF4BB08-1B74-11E5-8500-441C3E291000

获取网卡的MAC地址(WIN32_NETWORKADAPTER)

  1. wmic nic list full | findstr "MACAddress"
  2.  
  3. wmic nic where ( MACAddress is not null) get adaptertype , MACAddress
  4.  
  5. wmic nic where (MACAddress is not null and  PNPDeviceID like '%PCI%' ) get adaptertype , MACAddress

系统信息获取例子

wmic os       list brief /format:hform >PCinfo.html
wmic bios     list brief /format:hform >>PCinfo.html
wmic baseboard list brief /format:hform >>PCinfo.html
wmic csproduct list full /format:hform >>PCinfo.html
wmic cpu      list full /format:hform >>PCinfo.html
wmic nic       list full /format:hform >>PCinfo.html
wmic computersystem list brief /format:hform >>PCinfo.html
wmic diskdrive list full /format:hform >>PCinfo.html
wmic memphysical list full /format:hform >>PCinfo.html

pause
rem wmic process call create "shutdown.exe -s"

WMIC命令

  1.  

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 - 本地储存设备管理。
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 服务操作参数管理。

  1.  

所有Win32 Classes (Win32节点)

  1. Wmic Path Win32_1394Controller
  2. Wmic Path Win32_1394ControllerDevice
  3. Wmic Path Win32_Account
  4. Wmic Path Win32_AccountSID
  5. Wmic Path Win32_ACE
  6. Wmic Path Win32_ActionCheck
  7. Wmic Path Win32_ActiveRoute
  8. Wmic Path Win32_AllocatedResource
  9. Wmic Path Win32_ApplicationCommandLine
  10. Wmic Path Win32_ApplicationService
  11. Wmic Path Win32_AssociatedBattery
  12. Wmic Path Win32_AssociatedProcessorMemory
  13. Wmic Path Win32_AutochkSetting
  14. Wmic Path Win32_BaseBoard
  15. Wmic Path Win32_BaseService
  16. Wmic Path Win32_Battery
  17. Wmic Path Win32_Binary
  18. Wmic Path Win32_BindImageAction
  19. Wmic Path Win32_BIOS
  20. Wmic Path Win32_BootConfiguration
  21. Wmic Path Win32_Bus
  22. Wmic Path Win32_CacheMemory
  23. Wmic Path Win32_CDROMDrive
  24. Wmic Path Win32_CheckCheck
  25. Wmic Path Win32_CIMLogicalDeviceCIMDataFile
  26. Wmic Path Win32_ClassicCOMApplicationClasses
  27. Wmic Path Win32_ClassicCOMClass
  28. Wmic Path Win32_ClassicCOMClassSetting
  29. Wmic Path Win32_ClassicCOMClassSettings
  30. Wmic Path Win32_ClassInfoAction
  31. Wmic Path Win32_ClientApplicationSetting
  32. Wmic Path Win32_CodecFile
  33. Wmic Path Win32_CollectionStatistics
  34. Wmic Path Win32_COMApplication
  35. Wmic Path Win32_COMApplicationClasses
  36. Wmic Path Win32_COMApplicationSettings
  37. Wmic Path Win32_COMClass
  38. Wmic Path Win32_ComClassAutoEmulator
  39. Wmic Path Win32_ComClassEmulator
  40. Wmic Path Win32_CommandLineAccess
  41. Wmic Path Win32_ComponentCategory
  42. Wmic Path Win32_ComputerShutdownEvent
  43. Wmic Path Win32_ComputerSystem
  44. Wmic Path Win32_ComputerSystemEvent
  45. Wmic Path Win32_ComputerSystemProcessor
  46. Wmic Path Win32_ComputerSystemProduct
  47. Wmic Path Win32_ComputerSystemWindowsProductActivationSetting
  48. Wmic Path Win32_COMSetting
  49. Wmic Path Win32_Condition
  50. Wmic Path Win32_ConnectionShare
  51. Wmic Path Win32_ControllerHasHub
  52. Wmic Path Win32_CreateFolderAction
  53. Wmic Path Win32_CurrentProbe
  54. Wmic Path Win32_CurrentTime
  55. Wmic Path Win32_DCOMApplication
  56. Wmic Path Win32_DCOMApplicationAccessAllowedSetting
  57. Wmic Path Win32_DCOMApplicationLaunchAllowedSetting
  58. Wmic Path Win32_DCOMApplicationSetting
  59. Wmic Path Win32_DefragAnalysis
  60. Wmic Path Win32_DependentService
  61. Wmic Path Win32_Desktop
  62. Wmic Path Win32_DesktopMonitor
  63. Wmic Path Win32_DeviceBus
  64. Wmic Path Win32_DeviceChangeEvent
  65. Wmic Path Win32_DeviceMemoryAddress
  66. Wmic Path Win32_DeviceSettings
  67. Wmic Path Win32_DFSNode
  68. Wmic Path Win32_DFSNodeTarget
  69. Wmic Path Win32_DFSTarget
  70. Wmic Path Win32_Directory
  71. Wmic Path Win32_DirectorySpecification
  72. Wmic Path Win32_DiskDrive
  73. Wmic Path Win32_DiskDrivePhysicalMedia
  74. Wmic Path Win32_DiskDriveToDiskPartition
  75. Wmic Path Win32_DiskPartition
  76. Wmic Path Win32_DiskQuota
  77. Wmic Path Win32_DisplayConfiguration
  78. Wmic Path Win32_DisplayControllerConfiguration
  79. Wmic Path Win32_DMAChannel
  80. Wmic Path Win32_DriverForDevice
  81. Wmic Path Win32_DriverVXD
  82. Wmic Path Win32_DuplicateFileAction
  83. Wmic Path Win32_Environment
  84. Wmic Path Win32_EnvironmentSpecification
  85. Wmic Path Win32_ExtensionInfoAction
  86. Wmic Path Win32_Fan
  87. Wmic Path Win32_FileSpecification
  88. Wmic Path Win32_FloppyController
  89. Wmic Path Win32_FloppyDrive
  90. Wmic Path Win32_FontInfoAction
  91. Wmic Path Win32_Group
  92. Wmic Path Win32_GroupInDomain
  93. Wmic Path Win32_GroupUser
  94. Wmic Path Win32_HeatPipe
  95. Wmic Path Win32_IDEController
  96. Wmic Path Win32_IDEControllerDevice
  97. Wmic Path Win32_ImplementedCategory
  98. Wmic Path Win32_InfraredDevice
  99. Wmic Path Win32_IniFileSpecification
  100. Wmic Path Win32_InstalledSoftwareElement
  101. Wmic Path Win32_IP4PersistedRouteTable
  102. Wmic Path Win32_IP4RouteTable
  103. Wmic Path Win32_IP4RouteTableEvent
  104. Wmic Path Win32_IRQResource
  105. Wmic Path Win32_JobObjectStatus
  106. Wmic Path Win32_Keyboard
  107. Wmic Path Win32_LaunchCondition
  108. Wmic Path Win32_LoadOrderGroup
  109. Wmic Path Win32_LoadOrderGroupServiceDependencies
  110. Wmic Path Win32_LoadOrderGroupServiceMembers
  111. Wmic Path Win32_LocalTime
  112. Wmic Path Win32_LoggedOnUser
  113. Wmic Path Win32_LogicalDisk
  114. Wmic Path Win32_LogicalDiskRootDirectory
  115. Wmic Path Win32_LogicalDiskToPartition
  116. Wmic Path Win32_LogicalFileAccess
  117. Wmic Path Win32_LogicalFileAuditing
  118. Wmic Path Win32_LogicalFileGroup
  119. Wmic Path Win32_LogicalFileOwner
  120. Wmic Path Win32_LogicalFileSecuritySetting
  121. Wmic Path Win32_LogicalMemoryConfiguration
  122. Wmic Path Win32_LogicalProgramGroup
  123. Wmic Path Win32_LogicalProgramGroupDirectory
  124. Wmic Path Win32_LogicalProgramGroupItem
  125. Wmic Path Win32_LogicalProgramGroupItemDataFile
  126. Wmic Path Win32_LogicalShareAccess
  127. Wmic Path Win32_LogicalShareAuditing
  128. Wmic Path Win32_LogicalShareSecuritySetting
  129. Wmic Path Win32_LogonSession
  130. Wmic Path Win32_LogonSessionMappedDisk
  131. Wmic Path Win32_LUID
  132. Wmic Path Win32_LUIDandAttributes
  133. Wmic Path Win32_ManagedSystemElementResource
  134. Wmic Path Win32_MappedLogicalDisk
  135. Wmic Path Win32_MemoryArray
  136. Wmic Path Win32_MemoryArrayLocation
  137. Wmic Path Win32_MemoryDevice
  138. Wmic Path Win32_MemoryDeviceArray
  139. Wmic Path Win32_MemoryDeviceLocation
  140. Wmic Path Win32_MethodParameterClass
  141. Wmic Path Win32_MIMEInfoAction
  142. Wmic Path Win32_ModuleLoadTrace
  143. Wmic Path Win32_ModuleTrace
  144. Wmic Path Win32_MotherboardDevice
  145. Wmic Path Win32_MountPoint
  146. Wmic Path Win32_MoveFileAction
  147. Wmic Path Win32_MSIResource
  148. Wmic Path Win32_NamedJobObject
  149. Wmic Path Win32_NamedJobObjectActgInfo
  150. Wmic Path Win32_NamedJobObjectLimit
  151. Wmic Path Win32_NamedJobObjectLimitSetting
  152. Wmic Path Win32_NamedJobObjectProcess
  153. Wmic Path Win32_NamedJobObjectSecLimit
  154. Wmic Path Win32_NamedJobObjectSecLimitSetting
  155. Wmic Path Win32_NamedJobObjectStatistics
  156. Wmic Path Win32_NetworkAdapter
  157. Wmic Path Win32_NetworkAdapterConfiguration
  158. Wmic Path Win32_NetworkAdapterSetting
  159. Wmic Path Win32_NetworkClient
  160. Wmic Path Win32_NetworkConnection
  161. Wmic Path Win32_NetworkLoginProfile
  162. Wmic Path Win32_NetworkProtocol
  163. Wmic Path Win32_NTDomain
  164. Wmic Path Win32_NTEventlogFile
  165. Wmic Path Win32_NTLogEvent
  166. Wmic Path Win32_NTLogEventComputer
  167. Wmic Path Win32_NTLogEventLog
  168. Wmic Path Win32_NTLogEventUser
  169. Wmic Path Win32_ODBCAttribute
  170. Wmic Path Win32_ODBCDataSourceAttribute
  171. Wmic Path Win32_ODBCDataSourceSpecification
  172. Wmic Path Win32_ODBCDriverAttribute
  173. Wmic Path Win32_ODBCDriverSoftwareElement
  174. Wmic Path Win32_ODBCDriverSpecification
  175. Wmic Path Win32_ODBCSourceAttribute
  176. Wmic Path Win32_ODBCTranslatorSpecification
  177. Wmic Path Win32_OnBoardDevice
  178. Wmic Path Win32_OperatingSystem
  179. Wmic Path Win32_OperatingSystemAutochkSetting
  180. Wmic Path Win32_OperatingSystemQFE
  181. Wmic Path Win32_OSRecoveryConfiguration
  182. Wmic Path Win32_PageFile
  183. Wmic Path Win32_PageFileElementSetting
  184. Wmic Path Win32_PageFileSetting
  185. Wmic Path Win32_PageFileUsage
  186. Wmic Path Win32_ParallelPort
  187. Wmic Path Win32_Patch
  188. Wmic Path Win32_PatchFile
  189. Wmic Path Win32_PatchPackage
  190. Wmic Path Win32_PCMCIAController
  191. Wmic Path Win32_Perf
  192. Wmic Path Win32_PerfFormattedData
  193. Wmic Path Win32_PerfFormattedData_ASP_ActiveServerPages
  194. Wmic Path Win32_PerfFormattedData_ContentFilter_IndexingServiceFilter
  195. Wmic Path Win32_PerfFormattedData_ContentIndex_IndexingService
  196. Wmic Path Win32_PerfFormattedData_InetInfo_InternetInformationServicesGlobal
  197. Wmic Path Win32_PerfFormattedData_ISAPISearch_HttpIndexingService
  198. Wmic Path Win32_PerfFormattedData_MSDTC_DistributedTransactionCoordinator
  199. Wmic Path Win32_PerfFormattedData_NTFSDRV_SMTPNTFSStoreDriver
  200. Wmic Path Win32_PerfFormattedData_PerfDisk_LogicalDisk
  201. Wmic Path Win32_PerfFormattedData_PerfDisk_PhysicalDisk
  202. Wmic Path Win32_PerfFormattedData_PerfNet_Browser
  203. Wmic Path Win32_PerfFormattedData_PerfNet_Redirector
  204. Wmic Path Win32_PerfFormattedData_PerfNet_Server
  205. Wmic Path Win32_PerfFormattedData_PerfNet_ServerWorkQueues
  206. Wmic Path Win32_PerfFormattedData_PerfOS_Cache
  207. Wmic Path Win32_PerfFormattedData_PerfOS_Memory
  208. Wmic Path Win32_PerfFormattedData_PerfOS_Objects
  209. Wmic Path Win32_PerfFormattedData_PerfOS_PagingFile
  210. Wmic Path Win32_PerfFormattedData_PerfOS_Processor
  211. Wmic Path Win32_PerfFormattedData_PerfOS_System
  212. Wmic Path Win32_PerfFormattedData_PerfProc_FullImage_Costly
  213. Wmic Path Win32_PerfFormattedData_PerfProc_Image_Costly
  214. Wmic Path Win32_PerfFormattedData_PerfProc_JobObject
  215. Wmic Path Win32_PerfFormattedData_PerfProc_JobObjectDetails
  216. Wmic Path Win32_PerfFormattedData_PerfProc_Process
  217. Wmic Path Win32_PerfFormattedData_PerfProc_ProcessAddressSpace_Costly
  218. Wmic Path Win32_PerfFormattedData_PerfProc_Thread
  219. Wmic Path Win32_PerfFormattedData_PerfProc_ThreadDetails_Costly
  220. Wmic Path Win32_PerfFormattedData_PSched_PSchedFlow
  221. Wmic Path Win32_PerfFormattedData_PSched_PSchedPipe
  222. Wmic Path Win32_PerfFormattedData_RemoteAccess_RASPort
  223. Wmic Path Win32_PerfFormattedData_RemoteAccess_RASTotal
  224. Wmic Path Win32_PerfFormattedData_RSVP_ACSRSVPInterfaces
  225. Wmic Path Win32_PerfFormattedData_RSVP_ACSRSVPService
  226. Wmic Path Win32_PerfFormattedData_SMTPSVC_SMTPServer
  227. Wmic Path Win32_PerfFormattedData_Spooler_PrintQueue
  228. Wmic Path Win32_PerfFormattedData_TapiSrv_Telephony
  229. Wmic Path Win32_PerfFormattedData_Tcpip_ICMP
  230. Wmic Path Win32_PerfFormattedData_Tcpip_IP
  231. Wmic Path Win32_PerfFormattedData_Tcpip_NBTConnection
  232. Wmic Path Win32_PerfFormattedData_Tcpip_NetworkInterface
  233. Wmic Path Win32_PerfFormattedData_Tcpip_TCP
  234. Wmic Path Win32_PerfFormattedData_Tcpip_UDP
  235. Wmic Path Win32_PerfFormattedData_TermService_TerminalServices
  236. Wmic Path Win32_PerfFormattedData_TermService_TerminalServicesSession
  237. Wmic Path Win32_PerfFormattedData_W3SVC_WebService
  238. Wmic Path Win32_PerfRawData
  239. Wmic Path Win32_PerfRawData_ASP_ActiveServerPages
  240. Wmic Path Win32_PerfRawData_ContentFilter_IndexingServiceFilter
  241. Wmic Path Win32_PerfRawData_ContentIndex_IndexingService
  242. Wmic Path Win32_PerfRawData_InetInfo_InternetInformationServicesGlobal
  243. Wmic Path Win32_PerfRawData_ISAPISearch_HttpIndexingService
  244. Wmic Path Win32_PerfRawData_MSDTC_DistributedTransactionCoordinator
  245. Wmic Path Win32_PerfRawData_NTFSDRV_SMTPNTFSStoreDriver
  246. Wmic Path Win32_PerfRawData_PerfDisk_LogicalDisk
  247. Wmic Path Win32_PerfRawData_PerfDisk_PhysicalDisk
  248. Wmic Path Win32_PerfRawData_PerfNet_Browser
  249. Wmic Path Win32_PerfRawData_PerfNet_Redirector
  250. Wmic Path Win32_PerfRawData_PerfNet_Server
  251. Wmic Path Win32_PerfRawData_PerfNet_ServerWorkQueues
  252. Wmic Path Win32_PerfRawData_PerfOS_Cache
  253. Wmic Path Win32_PerfRawData_PerfOS_Memory
  254. Wmic Path Win32_PerfRawData_PerfOS_Objects
  255. Wmic Path Win32_PerfRawData_PerfOS_PagingFile
  256. Wmic Path Win32_PerfRawData_PerfOS_Processor
  257. Wmic Path Win32_PerfRawData_PerfOS_System
  258. Wmic Path Win32_PerfRawData_PerfProc_FullImage_Costly
  259. Wmic Path Win32_PerfRawData_PerfProc_Image_Costly
  260. Wmic Path Win32_PerfRawData_PerfProc_JobObject
  261. Wmic Path Win32_PerfRawData_PerfProc_JobObjectDetails
  262. Wmic Path Win32_PerfRawData_PerfProc_Process
  263. Wmic Path Win32_PerfRawData_PerfProc_ProcessAddressSpace_Costly
  264. Wmic Path Win32_PerfRawData_PerfProc_Thread
  265. Wmic Path Win32_PerfRawData_PerfProc_ThreadDetails_Costly
  266. Wmic Path Win32_PerfRawData_PSched_PSchedFlow
  267. Wmic Path Win32_PerfRawData_PSched_PSchedPipe
  268. Wmic Path Win32_PerfRawData_RemoteAccess_RASPort
  269. Wmic Path Win32_PerfRawData_RemoteAccess_RASTotal
  270. Wmic Path Win32_PerfRawData_RSVP_ACSRSVPInterfaces
  271. Wmic Path Win32_PerfRawData_RSVP_ACSRSVPService
  272. Wmic Path Win32_PerfRawData_SMTPSVC_SMTPServer
  273. Wmic Path Win32_PerfRawData_Spooler_PrintQueue
  274. Wmic Path Win32_PerfRawData_TapiSrv_Telephony
  275. Wmic Path Win32_PerfRawData_Tcpip_ICMP
  276. Wmic Path Win32_PerfRawData_Tcpip_IP
  277. Wmic Path Win32_PerfRawData_Tcpip_NBTConnection
  278. Wmic Path Win32_PerfRawData_Tcpip_NetworkInterface
  279. Wmic Path Win32_PerfRawData_Tcpip_TCP
  280. Wmic Path Win32_PerfRawData_Tcpip_UDP
  281. Wmic Path Win32_PerfRawData_TermService_TerminalServices
  282. Wmic Path Win32_PerfRawData_TermService_TerminalServicesSession
  283. Wmic Path Win32_PerfRawData_W3SVC_WebService
  284. Wmic Path Win32_PhysicalMedia
  285. Wmic Path Win32_PhysicalMemory
  286. Wmic Path Win32_PhysicalMemoryArray
  287. Wmic Path Win32_PhysicalMemoryLocation
  288. Wmic Path Win32_PingStatus
  289. Wmic Path Win32_PnPAllocatedResource
  290. Wmic Path Win32_PnPDevice
  291. Wmic Path Win32_PnPEntity
  292. Wmic Path Win32_PnPSignedDriver
  293. Wmic Path Win32_PnPSignedDriverCIMDataFile
  294. Wmic Path Win32_PointingDevice
  295. Wmic Path Win32_PortableBattery
  296. Wmic Path Win32_PortConnector
  297. Wmic Path Win32_PortResource
  298. Wmic Path Win32_POTSModem
  299. Wmic Path Win32_POTSModemToSerialPort
  300. Wmic Path Win32_PowerManagementEvent
  301. Wmic Path Win32_Printer
  302. Wmic Path Win32_PrinterConfiguration
  303. Wmic Path Win32_PrinterController
  304. Wmic Path Win32_PrinterDriver
  305. Wmic Path Win32_PrinterDriverDll
  306. Wmic Path Win32_PrinterSetting
  307. Wmic Path Win32_PrinterShare
  308. Wmic Path Win32_PrintJob
  309. Wmic Path Win32_PrivilegesStatus
  310. Wmic Path Win32_Process
  311.  
  312. ::::::AttachDebugger Method of the Win32_Process Class
  313. ::::::Create Method of the Win32_Process Class
  314. ::::::GetOwner Method of the Win32_Process Class
  315. ::::::GetOwnerSid Method of the Win32_Process Class
  316. ::::::SetPriority Method of the Win32_Process Class
  317. ::::::Terminate Method of the Win32_Process Class
  318.  
  319. Wmic Path Win32_Processor
  320. Wmic Path Win32_ProcessStartTrace
  321. Wmic Path Win32_ProcessStartup
  322. Wmic Path Win32_ProcessStopTrace
  323. Wmic Path Win32_ProcessTrace
  324. Wmic Path Win32_Product
  325. Wmic Path Win32_ProductCheck
  326. Wmic Path Win32_ProductResource
  327. Wmic Path Win32_ProductSoftwareFeatures
  328. Wmic Path Win32_ProgIDSpecification
  329. Wmic Path Win32_ProgramGroup
  330. Wmic Path Win32_ProgramGroupContents
  331. Wmic Path Win32_ProgramGroupOrItem
  332. Wmic Path Win32_Property
  333. Wmic Path Win32_ProtocolBinding
  334. Wmic Path Win32_Proxy
  335. Wmic Path Win32_PublishComponentAction
  336. Wmic Path Win32_QuickFixEngineering
  337. Wmic Path Win32_QuotaSetting
  338. Wmic Path Win32_Refrigeration
  339. Wmic Path Win32_Registry
  340. Wmic Path Win32_RegistryAction
  341. Wmic Path Win32_RemoveFileAction
  342. Wmic Path Win32_RemoveIniAction
  343. Wmic Path Win32_ReserveCost
  344. Wmic Path Win32_ScheduledJob
  345. Wmic Path Win32_SCSIController
  346. Wmic Path Win32_SCSIControllerDevice
  347. Wmic Path Win32_SecurityDescriptor
  348. Wmic Path Win32_SecurityDescriptorHelper
  349. Wmic Path Win32_SecuritySetting
  350. Wmic Path Win32_SecuritySettingAccess
  351. Wmic Path Win32_SecuritySettingAuditing
  352. Wmic Path Win32_SecuritySettingGroup
  353. Wmic Path Win32_SecuritySettingOfLogicalFile
  354. Wmic Path Win32_SecuritySettingOfLogicalShare
  355. Wmic Path Win32_SecuritySettingOfObject
  356. Wmic Path Win32_SecuritySettingOwner
  357. Wmic Path Win32_SelfRegModuleAction
  358. Wmic Path Win32_SerialPort
  359. Wmic Path Win32_SerialPortConfiguration
  360. Wmic Path Win32_SerialPortSetting
  361. Wmic Path Win32_ServerConnection
  362. Wmic Path Win32_ServerSession
  363. Wmic Path Win32_Service
  364. Wmic Path Win32_ServiceControl
  365. Wmic Path Win32_ServiceSpecification
  366. Wmic Path Win32_ServiceSpecificationService
  367. Wmic Path Win32_Session
  368. Wmic Path Win32_SessionConnection
  369. Wmic Path Win32_SessionProcess
  370. Wmic Path Win32_SettingCheck
  371. Wmic Path Win32_ShadowBy
  372. Wmic Path Win32_ShadowContext
  373. Wmic Path Win32_ShadowCopy
  374. Wmic Path Win32_ShadowDiffVolumeSupport
  375. Wmic Path Win32_ShadowFor
  376. Wmic Path Win32_ShadowOn
  377. Wmic Path Win32_ShadowProvider
  378. Wmic Path Win32_ShadowStorage
  379. Wmic Path Win32_ShadowVolumeSupport
  380. Wmic Path Win32_Share
  381. Wmic Path Win32_ShareToDirectory
  382. Wmic Path Win32_ShortcutAction
  383. Wmic Path Win32_ShortcutFile
  384. Wmic Path Win32_ShortcutSAP
  385. Wmic Path Win32_SID
  386. Wmic Path Win32_SIDandAttributes
  387. Wmic Path Win32_SMBIOSMemory
  388. Wmic Path Win32_SoftwareElement
  389. Wmic Path Win32_SoftwareElementAction
  390. Wmic Path Win32_SoftwareElementCheck
  391. Wmic Path Win32_SoftwareElementCondition
  392. Wmic Path Win32_SoftwareElementResource
  393. Wmic Path Win32_SoftwareFeature
  394. Wmic Path Win32_SoftwareFeatureAction
  395. Wmic Path Win32_SoftwareFeatureCheck
  396. Wmic Path Win32_SoftwareFeatureParent
  397. Wmic Path Win32_SoftwareFeatureSoftwareElements
  398. Wmic Path Win32_SoundDevice
  399. Wmic Path Win32_StartupCommand
  400. Wmic Path Win32_SubDirectory
  401. Wmic Path Win32_SystemAccount
  402. Wmic Path Win32_SystemBIOS
  403. Wmic Path Win32_SystemBootConfiguration
  404. Wmic Path Win32_SystemConfigurationChangeEvent
  405. Wmic Path Win32_SystemDesktop
  406. Wmic Path Win32_SystemDevices
  407. Wmic Path Win32_SystemDriver
  408. Wmic Path Win32_SystemDriverPnPEntity
  409. Wmic Path Win32_SystemEnclosure
  410. Wmic Path Win32_SystemLoadOrderGroups
  411. Wmic Path Win32_SystemLogicalMemoryConfiguration
  412. Wmic Path Win32_SystemMemoryResource
  413. Wmic Path Win32_SystemNetworkConnections
  414. Wmic Path Win32_SystemOperatingSystem
  415. Wmic Path Win32_SystemPartitions
  416. Wmic Path Win32_SystemProcesses
  417. Wmic Path Win32_SystemProgramGroups
  418. Wmic Path Win32_SystemResources
  419. Wmic Path Win32_SystemServices
  420. Wmic Path Win32_SystemSetting
  421. Wmic Path Win32_SystemSlot
  422. Wmic Path Win32_SystemSystemDriver
  423. Wmic Path Win32_SystemTimeZone
  424. Wmic Path Win32_SystemTrace
  425. Wmic Path Win32_SystemUsers
  426. Wmic Path Win32_TapeDrive
  427. Wmic Path Win32_TCPIPPrinterPort
  428. Wmic Path Win32_TemperatureProbe
  429. Wmic Path Win32_Thread
  430. Wmic Path Win32_ThreadStartTrace
  431. Wmic Path Win32_ThreadStopTrace
  432. Wmic Path Win32_ThreadTrace
  433. Wmic Path Win32_TimeZone
  434. Wmic Path Win32_TokenGroups
  435. Wmic Path Win32_TokenPrivileges
  436. Wmic Path Win32_Trustee
  437. Wmic Path Win32_TypeLibraryAction
  438. Wmic Path Win32_UninterruptiblePowerSupply
  439. Wmic Path Win32_USBController
  440. Wmic Path Win32_USBControllerDevice
  441. Wmic Path Win32_USBHub
  442. Wmic Path Win32_UserAccount
  443. Wmic Path Win32_UserDesktop
  444. Wmic Path Win32_UserInDomain
  445. Wmic Path Win32_UTCTime
  446. Wmic Path Win32_VideoConfiguration
  447. Wmic Path Win32_VideoController
  448. Wmic Path Win32_VideoSettings
  449. Wmic Path Win32_VoltageProbe
  450. Wmic Path Win32_Volume
  451. Wmic Path Win32_VolumeChangeEvent
  452. Wmic Path Win32_VolumeQuota
  453. Wmic Path Win32_VolumeQuotaSetting
  454. Wmic Path Win32_VolumeUserQuota
  455. Wmic Path Win32_WindowsProductActivation
  456. Wmic Path Win32_WMIElementSetting
  457. Wmic Path Win32_WMISetting
  458.  
  459. 手把手教你如何Get筛选类型
  460.  
  461. 有了上面一些命令后,执行后窗口显示的往往是乱七八糟大部分都是些不想要的信息,这时我们就要筛选出自己想要的内容了。
  462. —————————————————————————————————————————————
  463.  
  464. 例子:
  465. 遍历本地磁盘信息,筛选只显示“文件系统”“驱动器类型”“盘符”其他乱七八糟的一概不显示
  466. 步骤1 WMIC Path Win32_LogicalDisk>tmp.txt得到的一个乱七八糟的磁盘信息文本
  467. 步骤2 打开tmp.txt会看到下面内容,因为篇幅不够这里就只贴部分内容了
  468. Description DeviceID FileSystem FreeSpace ........
  469. 3 1/2 英寸软盘驱动器 A: ........
  470. 本地固定磁盘 C: NTFS 1521709056 ........
  471. 本地固定磁盘 D: NTFS 4812705792 ........
  472. 本地固定磁盘 E: FAT32 2951413760 ........
  473. CD-ROM 磁盘 F: ........
  474. CD-ROM 磁盘 G: CDFS 0 ........
  475. 步骤3:如上所示红色部分就是分支节点名称,这样我们可以用Get去筛选了,开始输入命令
  476. WMIC Path Win32_LogicalDisk Get Description,DeviceID,FileSystem
  477. 好了屏幕显示的内容是不是很整齐啊,如果想分行显示可以在命令后面加/format:list
  478.  
  479. for遍历所有本地磁盘盘符到%Disk%变量例子
  480.  
  481. --------------------------------------------------------------------------------
  482.  
  483. @echo off
  484. for /f "skip=2 tokens=3* delims=," %%i in ('WMIC Path Win32_LogicalDisk Get Description^,DeviceID^,FileSystem /format:csv^|findstr /i /v "英寸 CD-ROM"') do call set Disk=%%Disk%% %%i
  485. set Disk=%Disk:~1%
  486. echo %Disk%
  487. pause
  488. 遍历所有本地FAT32文件系统磁盘盘符到%FATDisk%变量例子
  489.  
  490. --------------------------------------------------------------------------------
  491.  
  492. @echo off
  493. for /f "skip=2 tokens=3* delims=," %%i in ('WMIC Path Win32_LogicalDisk Get Description^,DeviceID^,FileSystem /format:csv^|findstr /i /v "英寸 CD-ROM 移动 NTFS"') do call set FATDisk=%%FATDisk%% %%i
  494. set FATDisk=%FATDisk:~1%
  495. echo %FATDisk%
  496. pause
  497. 遍历所有本地可移动磁盘盘符到%USBDisk%变量例子
  498.  
  499. --------------------------------------------------------------------------------
  500.  
  501. @echo off
  502. for /f "tokens=3* delims=," %%i in ('WMIC Path Win32_LogicalDisk Get DeviceID^,FileSystem^,Description /format:csv^|find /i "移动"') do call set USBDisk=%%USBDisk%% %%i
  503. echo %USBDisk:~1%
  504. pause
  505. 遍历所有本地CD-ROM盘符到%CDROM%变量例子
  506.  
  507. --------------------------------------------------------------------------------
  508.  
  509. @echo off
  510. for /f "tokens=3* delims=," %%i in ('WMIC Path Win32_LogicalDisk Get DeviceID^,FileSystem^,Description /format:csv^|find /i "CD-ROM"') do call set CDROM=%%CDROM%% %%i
  511. echo %CDROM:~1%
  512. pause
  513. 遍历非闲置(有光盘的)CD-ROM盘符到%CDROM%变量例子
  514.  
  515. --------------------------------------------------------------------------------
  516.  
  517. @echo off
  518. for /f "tokens=3* delims=," %%i in ('WMIC Path Win32_LogicalDisk Get DeviceID^,FileSystem^,Description /format:csv^|find /i "CD-ROM"^|find "CDFS"') do call set CDROM=%%CDROM%% %%i
  519. echo %CDROM:~1%
  520. pause
  521. 遍历移动硬盘盘符到%RemovalDisk%变量例子(非U盘)
  522.  
  523. --------------------------------------------------------------------------------
  524.  
  525. @echo off
  526. for /f "tokens=3* delims=," %%i in ('WMIC Path Win32_LogicalDisk Get DeviceID^,VolumeDirty^,Description /format:csv^|find /i "TRUE"') do call set RemovalDisk=%%RemovalDisk%% %%i
  527. if not "%RemovalDisk%"=="" echo %RemovalDisk:~1%
  528. pause
  529.  
  530. WMI命令行示例(某某同志看到下面示例比较眼熟别埋怨我^_^)
  531. BIOS - 基本输入/输出服务 (BIOS) 管理
  532. ::查看bios版本型号
  533. wmic bios get Manufacturer,Name
  534.  
  535. COMPUTERSYSTEM - 计算机系统管理
  536. ::查看系统启动选项,boot的内容
  537. wmic COMPUTERSYSTEM get SystemStartupOptions
  538. ::查看工作组/域
  539. wmic computersystem get domain
  540. ::更改计算机名abc123
  541. wmic computersystem where "name='abc'" call rename 123
  542. ::更改工作组googleMyGroup
  543. wmic computersystem where "name='google'" call joindomainorworkgroup "","","MyGroup",1
  544.  
  545. CPU - CPU 管理
  546. ::查看cpu型号
  547. wmic cpu get name
  548.  
  549. DATAFILE - DataFile 管理
  550. ::查找e盘下test目录(不包括子目录)下的cc.cmd文件
  551. wmic datafile where "drive='e:' and path='\\test\\' and FileName='cc' and Extension='cmd'" list
  552. ::查找e盘下所有目录和子目录下的cc.cmd文件,且文件大小大于1K
  553. wmic datafile where "drive='e:' and FileName='cc' and Extension='cmd' and FileSize>'1000'" list
  554. ::删除e盘下文件大小大于10M的.cmd文件
  555. wmic datafile where "drive='e:' and Extension='cmd' and FileSize>'10000000'" call delete
  556. ::删除e盘下test目录(不包括子目录)下的非.cmd文件
  557. wmic datafile where "drive='e:' and Extension<>'cmd' and path='test'" call delete
  558. ::复制e盘下test目录(不包括子目录)下的cc.cmd文件到e:\,并改名为aa.bat
  559. wmic datafile where "drive='e:' and path='\\test\\' and FileName='cc' and Extension='cmd'" call copy "e:\aa.bat"
  560. ::改名c:\hello.txtc:\test.txt
  561. wmic datafile "c:\\hello.txt" call rename c:\test.txt
  562. ::查找h盘下目录含有test,文件名含有perl,后缀为txt的文件
  563. wmic datafile where "drive='h:' and extension='txt' and path like '%\\test\\%' and filename like '%perl%'" get name
  564.  
  565. DESKTOPMONITOR - 监视器管理
  566. ::获取屏幕分辨率
  567. wmic DESKTOPMONITOR where Status='ok' get ScreenHeight,ScreenWidth
  568.  
  569. DISKDRIVE - 物理磁盘驱动器管理
  570. ::获取物理磁盘型号大小等
  571. wmic DISKDRIVE get Caption,size,InterfaceType
  572.  
  573. ENVIRONMENT - 系统环境设置管理
  574. ::获取temp环境变量
  575. wmic ENVIRONMENT where "name='temp'" get UserName,VariableValue
  576. ::更改path环境变量值,新增e:\tools
  577. wmic ENVIRONMENT where "name='path' and username='<system>'" set VariableValue="%path%;e:\tools"
  578. ::新增系统环境变量home,值为%HOMEDRIVE%%HOMEPATH%
  579. wmic ENVIRONMENT create name="home",username="<system>",VariableValue="%HOMEDRIVE%%HOMEPATH%"
  580. ::删除home环境变量
  581. wmic ENVIRONMENT where "name='home'" delete
  582.  
  583. FSDIR - 文件目录系统项目管理
  584. ::查找e盘下名为test的目录
  585. wmic FSDIR where "drive='e:' and filename='test'" list
  586. ::删除e:\test目录下除过目录abc的所有目录
  587. wmic FSDIR where "drive='e:' and path='\\test\\' and filename<>'abc'" call delete
  588. ::删除c:\good文件夹
  589. wmic fsdir "c:\\good" call delete
  590. ::重命名c:\good文件夹为abb
  591. wmic fsdir "c:\\good" rename "c:\abb"
  592.  
  593. LOGICALDISK - 本地储存设备管理
  594. ::获取硬盘系统格式、总大小、可用空间等
  595. wmic LOGICALDISK get name,Description,filesystem,size,freespace
  596.  
  597. NIC - 网络界面控制器 (NIC) 管理
  598.  
  599. OS - 已安装的操作系统管理
  600. ::设置系统时间
  601. wmic os where(primary=1) call setdatetime 20070731144642.555555+480
  602.  
  603. PAGEFILESET - 页面文件设置管理
  604. ::更改当前页面文件初始大小和最大值
  605. wmic PAGEFILESET set InitialSize="512",MaximumSize="512"
  606. ::页面文件设置到d:\下,执行下面两条命令
  607. wmic pagefileset create name='d:\pagefile.sys',initialsize=512,maximumsize=1024
  608. wmic pagefileset where"name='c:\\pagefile.sys'" delete
  609.  
  610. PROCESS - 进程管理
  611. ::列出进程的核心信息,类似任务管理器
  612. wmic process list brief
  613. ::结束svchost.exe进程,路径为非C:\WINDOWS\system32\svchost.exe
  614. wmic process where "name='svchost.exe' and ExecutablePath<>'C:\\WINDOWS\\system32\\svchost.exe'" call Terminate
  615. ::新建notepad进程
  616. wmic process call create notepad
  617.  
  618. PRODUCT - 安装包任务管理
  619. ::安装包在C:\WINDOWS\Installer目录下
  620. ::卸载.msi安装包
  621. wmic PRODUCT where "name='Microsoft .NET Framework 1.1' and Version='1.1.4322'" call Uninstall
  622. ::修复.msi安装包
  623. wmic PRODUCT where "name='Microsoft .NET Framework 1.1' and Version='1.1.4322'" call Reinstall
  624.  
  625. SERVICE - 服务程序管理
  626. ::运行spooler服务
  627. wmic SERVICE where name="Spooler" call startservice
  628. ::停止spooler服务
  629. wmic SERVICE where name="Spooler" call stopservice
  630. ::暂停spooler服务
  631. wmic SERVICE where name="Spooler" call PauseService
  632. ::更改spooler服务启动类型[auto|Disabled|Manual] 释[自动|禁用|手动]
  633. wmic SERVICE where name="Spooler" set StartMode="auto"
  634. ::删除服务
  635. wmic SERVICE where name="test123" call delete
  636.  
  637. SHARE - 共享资源管理
  638. ::删除共享
  639. wmic SHARE where name="e$" call delete
  640. ::添加共享
  641. WMIC SHARE CALL Create "","test","3","TestShareName","","c:\test",0
  642.  
  643. SOUNDDEV - 声音设备管理
  644. wmic SOUNDDEV list
  645.  
  646. STARTUP - 用户登录到计算机系统时自动运行命令的管理
  647. ::查看msconfig中的启动选项
  648. wmic STARTUP list
  649.  
  650. SYSDRIVER - 基本服务的系统驱动程序管理
  651. wmic SYSDRIVER list
  652.  
  653. USERACCOUNT - 用户帐户管理
  654. ::更改用户administrator全名为admin
  655. wmic USERACCOUNT where name="Administrator" set FullName="admin"
  656. ::更改用户名adminadmin00
  657. wmic useraccount where "name='admin" call Rename admin00
  658.  
  659. Datafile 别名
  660. wmic datafile "c:\\hello.txt" call rename c:\ppp.txt
  661.  
  662. wmic datafile Where "drive='d:' and extension='txt' and path='\\'" get name
  663. WMIC FSDIR别名
  664.  
  665. wmic fsdir where(name='c:\\good') delete
  666. wmic fsdir where(name='c:\\good') call delete
  667. 删除c:\good文件夹
  668.  
  669. wmic fsdir where(name='c:\\good') rename "c:\abb"
  670. 重命名c:\good文件夹为abb
  671.  
  672. 复制文件夹
  673. wmic fsdir where(name='d:\\test') call copy "c:\ppcd"
  674. 复制D盘下TEST文件夹的所有文件到C盘下的PPCD,如果PPCD存在直接复制过去,如果不存在他会自动创建并将文件复制过去
  675. wmic fsdir where(name='d:\\test') call Compress
  676. 压缩指定文件夹,以便节省磁盘空间
  677. wmic fsdir where(name='d:\\test') call unCompress
  678.  
  679. 解除压缩文件夹
  680. Job 别名
  681. wmic job call create "sol.exe",0,0,1,0,********154600.000000+480
  682.  
  683. 这个命令和AT命令是一模一样啊,AT添加的计划任务他可以看到,他添加的同样AT命令也是可以看到
  684. wmic job call create "sol.exe",0,0,true,false,********154800.000000+480
  685. wmic job call create "sol.exe",0,0,1,0,********154600.000000+480
  686. 这两句是相同的,TRUE可以用1表示,同样的FALSE可以用0值表示,时间前为何用八个星号,这是WMIC的特性,他显示时间的方式是YYYYMMDDHHMMSS.MMMMMM+时区 ,可是,我们并不需要指定年份和月份还有天,所以用*星号来替代
  687.  
  688. Os 别名
  689. wmic os Where (primary='1') call win32shutdown *
  690. 这个*参数可以有如下值:
  691. Const LOGOFF=0
  692. Const SHUTDOWN=1
  693. Const REBOOT=2
  694. Const FORCE=4
  695. Const POWEROFF=8
  696. 这些参数可以进行任意组合,例如:
  697. 强制注销:4 (0+4)的组合
  698. 强制关机:5 (1+4)的组合
  699. 强制重启:6 (2+4)的组合
  700. 强制关闭电源:12 (8+4)的组合
  701.  
  702. WMIC设置系统时间
  703. 要求需要有管理员权限
  704. wmic os where(primary=1) call setdatetime 20070731144642.555555+480
  705.  
  706. Process 别名
  707. wmic process call create sol.exe
  708. wmic process 3848 call terminate
  709. 可以看出PROCESS别名是以HANDLE属性为默认属性进行操作的
  710. wmic process 2556 call setpriority 64
  711. wmic process Where "processid='%pid%'" call Terminate
  712. wmic process Where "name='%imagename%'" call Terminate
  713. wmic path Win32_Process.name="%imagename%" call Terminate
  714. wmic path Win32_Process.processid="%pid%" call Terminate
  715. wmic process Where name='sol.exe' delete
  716.  
  717. Nicconfig 别名
  718. wmic nicconfig where(index='8') call enablestatic "192.168.1.81","255.255.255.0"   
  719. 设置IP地址和子网掩码
  720. wmic nicconfig where(index='8') call setgateways "192.168.0.1",1          
  721. 设置网关和跃点数
  722. wmic nicconfig where(index='8') call setdnsdomain ("192.168.0.1","192.168.0.11")  
  723. 设置DNS服务器地址,设置完毕后不会马上生效,必需要设置主次才可以生效
  724. wmic nicconfig where(index='8') call SetDNSServerSearchOrder ("192.168.0.1","192.168.0.11") 
  725. 设置DNS服务器地址的主次顺序,192.168.0.1在前表示为首选DNS地址,在后为备用DNS地址
  726. wmic path Win32_NetworkAdapterConfiguration.index=8 call enabledhcp
  727. WMIC默认的NICCONFIG别名是不提供enabledhcp这个方法的,所以我们只能调用他的WMI函数来设置动态分配IP地址的设置
  728. wmic nicconfig where(index='8') get /value ###INDEX值为你当前网卡的索引值,每台机器都不一样
  729.  
  730. WMIC对注册表的操作
  731. wmic /namespace:\\root\default path stdregprov call getstringvalue ^&H80000002,"SOFTWARE\libowen","hello"
  732. wmic /namespace:\\root\default path stdregprov call createkey ^&h80000001,"libowen\good"
  733. 建立libowen\good 这个键值
  734. wmic /namespace:\\root\default path stdregprov call deletekey ^&h80000001,"libowen\sdd"  
  735. 删除键值SDD,注意此键值必须是最底层
  736. wmic /namespace:\\root\default path stdregprov call EnumKey ^&h80000001,"Keyboard Layout"
  737. 枚举Keyboard Layout下的所有子键值
  738. wmic /namespace:\\root\default path stdregprov call Enumvalues ^&h80000001,"Keyboard Layout\preload"
  739. 枚举Keyboard Layout\preload这个键值下的所有数值及其数值所对应的类型
  740. wmic /namespace:\\root\default path stdregprov call SetStringValue ^&h80000001,"libowen\test","hello world!","test"
  741. 建立一个名为teststring的数值,值为hello world!
  742. wmic /namespace:\\root\default path stdregprov call SetStringValue ^&h80000001,"libowen\test","test","aabb"
  743. 修改aabb的数值为test
  744.  
  745. Pagefileset 别名
  746. wmic pagefileset get /value
  747. 用来察看本地计算机虚拟内存情况,初始大小,最大值,保存位置等
  748. 下面我们可以改变虚拟内存文件(也就是我们常说的页面文件) 所在位置以及初始大小和最大值
  749. wmic pagefileset set initialsize=512,maximumsize=1024
  750. 这个只是改变初始大小和最大值,SET不能修改页面文件所存放的位置,也就是说默认页面文件在C盘这时不能把他的位置修改到D盘,如果要修改到D盘我们可以这样来做
  751. wmic pagefileset create name='d:\pagefile.sys',initialsize=512,maximumsize=1024
  752. 然后删除以前的就可以了,请看
  753. wmic pagefileset where "name='c:\\pagefile.sys'" delete
  754. 这样就实现了把页面文件转移到D盘的效果
  755.  
  756. WMIC设置代理服务器
  757. wmic path win32_proxy get /value
  758. wmic path win32_proxy Where ServerName='ql-libowen.ql-art.com' call setproxysetting "8080","192.168.1.59"
  759. wmic path win32_proxy.servername="ql-libowen.ql-art.com" call setproxysetting "",""
  760.  
  761. WMIC 设置共享
  762. 输入参数是 OBJECT 类型
  763. 原因:对于 OBJECT 类型的输入参数,还没有实现全面支持。默认值(空字符串:"")是目前支持的唯一值。
  764. 解决方案:使用下面的命令为三个用户设置 c:\test 目录的共享:
  765. WMIC SHARE CALL Create "","test","3","TestShareName","","c:\test",0
  766.  
  767. 建立共享文件夹
  768. WMIC SHARE where(path='c:\\test') call delete
  769.  
  770. WMIC对于共享文件夹操作
  771. WMIC SHARE where(path='c:\\test') delete
  772.  
  773. Computersystem 别名
  774. wmic computersystem Where "name='原计算机名称'" call rename "要修改的计算机名"
  775. 主要功能:修改计算机名称
  776. wmic computersystem Where "name='计算机名称'" call joindomainorworkgroup "","","MyGroup"
  777. 主要功能:更改现有工作组为指定的工作组
  778. wmic computersystem Where "name='计算机名称' call UnjoinDomainOrWorkgroup
  779. 主要功能:退出所在域
  780. wmic computersystem Where "name='计算机名称'" call joindomainorworkgroup "",1,"域名称","域管理员密码","域管理员用户名"
  781.  
  782. Useraccount 别名
  783. wmic useraccount where(LocalAccount='1' and name='good') set disabled=true
  784. wmic useraccount where(LocalAccount='1' and name='good') set fullname="hello world!"
  785. wmic useraccount where(localaccount=true and name='good') set passwordchangeable=true
  786. wmic useraccount Where "domain='ql-libowen' and name='libowen'" set PasswordExpires=false
微软官方最齐全的 WMI VBScript 实例 Scriptomatic 2.0

windows脚本教程:Managing Windows with VBScript and WMI.chm

开启远程计算机的远程桌面(注意关闭远程防火墙)

通过注册表,远程连接到远端计算机,找到 HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server,在Terminal Server键下,名为fDenyTSConnection的REG_DWORD型键值。双击这个键值打开“编辑DWORD值”对话框,把1(禁用远程桌面)改成0(启用远程桌面)

判断远端计算机WMI服务是否正常的方法

  1. wmic /user:username /password:yourpassword /node:remotemachine systemenclosure get serialnumber

如果得到的结果如下,则远端WMI是正常服务的。

Serial Number

W23HN769U-9 (the serial number from the machine)

  1. wmic /node:192.168.1.3 /user:administrator path win32_terminalservicesetting where (servername!="") call setallowtsconnections 1
  1. wmic /node:192.168.1.3 /user:administrator path win32_terminalservicesetting where (__Class!="") call setallowtsconnections 1

参考:

http://www.bathome.net/viewthread.php?tid=4068#pid25946

http://www.bathome.net/thread-4068-1-1.html

http://www.bathome.net/thread-420-1-1.html

http://www.bathome.net/thread-534-1-1.html

http://www.bathome.net/thread-377-1-1.html

Windows WMIC命令使用详解(附实例)

https://www.computerperformance.co.uk/

本地服务器硬件信息获取指令wmic的更多相关文章

  1. (部署新java程序,程序报错,需copy的一个包)——java使用siger 获取服务器硬件信息

    mcat-siger.sh  查看是否安装siger rsync -aPuv /usr/lib64/libsigar-amd64-linux.so $i:/usr/lib64/ java使用siger ...

  2. java使用siger 获取服务器硬件信息(CPU 内存 网络 io等)

    通过使用第三方开源jar包sigar.jar我们可以获得本地的信息 1.下载sigar.jar sigar官方主页 sigar-1.6.4.zip 2.按照主页上的说明解压包后将相应的文件copy到j ...

  3. Android设备网络、屏幕尺寸、SD卡、本地IP、存储空间等信息获取工具类

    Android设备网络.屏幕尺寸.SD卡.本地IP.存储空间.服务.进程.应用包名等信息获取的整合工具类. package com.qiyu.ddb.util; import android.anno ...

  4. 用python获取服务器硬件信息[转]

    #!/usr/bin/env python # -*- coding: utf-8 -*- import rlcompleter, readline readline.parse_and_bind(' ...

  5. 通过wmi获取本地硬件信息的一些疑问。

    通过wmi获取本地硬件信息的一些疑问. http://bbs.csdn.net/topics/391017789 http://blog.csdn.net/xcntime/article/detail ...

  6. C#操作office进行Excel图表创建,保存本地,word获取

    ,新建C#控制台应用程序(Excel创建图表) using System; using System.Collections.Generic; using System.Linq; using Sys ...

  7. windows主机网络信息获取程序设计

    掌握windows系统获取网络信息的各种API函数的功能与调用方法,掌握设计程序显示获取到相关网络信息的方法,掌握网络字节数据与主机字节数据之间的转换.掌握这些API函数调用的错误处理方法. 利用本地 ...

  8. sigar 监控服务器硬件信息

    转载 http://www.cnblogs.com/jifeng/archive/2012/05/16/2503519.html 通过使用第三方开源jar包sigar.jar我们可以获得本地的信息 1 ...

  9. 二十一.构建memcached服务、LNMP+memcached、PHP的本地Session信息、PHP实现session共享

    proxy client web1 web2   1.构建memcached服务 ]# yum -y install memcached ]# cat /etc/sysconfig/memcached ...

随机推荐

  1. 【4】Asp.Net Core2.2中间件多扩展对应应用

    [前言] 上一篇完成了Asp.Net Core 2.2全新的管道处理模型解析,“俄罗斯套娃”式的委托嵌套和传递,组建了扩展性无与伦比的管道模型!与此同时,委托嵌套过于复杂,使用起来并不友好,然后多种扩 ...

  2. Doskey命令详解

    转自:https://blog.csdn.net/u012993732/article/details/48626921 调用 Doskey.exe,它撤回 Windows XP 命令.编辑命令行并创 ...

  3. Sqlserver 事务处理模板

    USE StuDB GO /****** Object: StoredProcedure [dbo].[proc_live_send_answer_v4] Script Date: 06/20/201 ...

  4. C 实现自己构建的数组

    #include<stdio.h>#include<malloc.h>#include<stdlib.h>#include<stdbool.h>stru ...

  5. Cocos Creator—如何给资源打MD5版本号

    Cocos Creator 是Cocos最新一代的游戏开发者工具,基于 Cocos2d-x,组件化,脚本化,数据驱动,跨平台发布.Cocos Creator的开发思路已经逐步跟Unity 3D靠拢,写 ...

  6. 漫谈Linux标准的文件系统(Ext2/Ext3/Ext4)

    Ext 全称Linux extended file system, extfs,即Linux扩展文件系统,Ext2就代表第二代文件扩展系统,Ext3/Ext4以此类推,它们都是Ext2的升级版,只不过 ...

  7. 理解Linux文档的默认安全机制、隐藏属性、特殊权限,妈妈在也不用担心你从删库到跑路!!!

    写在前面 前面的章节 详解Linux文档属性.拥有者.群组.权限.差异,介绍了文档的基本权限,包括读写执行(r,w,x),还有文档若干的属性,包括是否为目录(d).文件(-).链接文件(l).拥有者. ...

  8. AI - TensorFlow - 第一个神经网络(First Neural Network)

    Hello world # coding=utf-8 import tensorflow as tf import os os.environ[' try: tf.contrib.eager.enab ...

  9. 关闭 Mac 拼写自动纠正与横线转换

    如果你是个程序员, 如果你恰好用 mac 自带的 notes 来做笔记, 很大可能性, 你会在里面贴代码, 但是, Mac 的拼写检查和自动纠正功能,会把代码变成你不想要的样子, 比如, 它会为你首字 ...

  10. Python实战171203统计

    统计序列中元素出现的频次 如何统计出某一个随机数列的元素出现的次数是多少? import randomdata=[random.randint(0,7) for _ in range(15)]c=di ...