2012年12月21日星期五
powerful wmic windows command-line tool
powerful wmic windows command-line tool
windows most network management criticized is the command-line unix and linux powerful. But this situation is being constantly improved windows command line more and more powerful. Among them, Microsoft spent a lot of effort to build wmi is an example.
Process ID and process name
Code:
wmic process get processid, name
Remote creation process
Code:
wmic / node: 109.254.2.102 / user: "rdgad \ administrator / password:" dream come true "process call the create commandline, =" cmd.exe / k echo xxxxx | clip.exe
Get cpu name, digits, serial number
Code:
wmic cpu get name, addresswidth, processorid
Get the number of physical memory
Code:
wmic memlogical get totalphysicalmemory
Brand machine serial number
Code:
wmic csproduct get IdentifyingNumber
To join the domain
Code:
wmic computersystem where name = "% computername%" call joindomainorworkgroup name = "www.777avia.com" username = "rdgad \ adddomain" password = "mxcz" fjoinoptions = 1 accountou = null
Get the total capacity of the hard disk www.777avia.com
Code:
wmic diskdrive get deviceid, size
Start a service
Code:
WMIC SERVICE where caption = 'TELNET' CALL STARTSERVICE
Kill a process
Code:
WMIC PROCESS where name = 'calc.exe' delete
Get the cpu usage percentage
Code:
wmic path Win32_PerfFormattedData_PerfProc_Process get Name, PercentProcessorTime
wmic cpu get LoadPercentage
.................................................. ..
More specific help in the command line, type wmic /? Queries.
订阅:
博文评论 (Atom)
没有评论:
发表评论