菜鸟成长日记(五)之WMIC简单命令应用

简介:
    晚上,睡不着.帮大家收集整理了些.关于wmic的命令...大家可以练练...最近要考试了,教程没时间更新.忘大家见谅....
As promised, here are the sample WMIC commands I demonstrated in the Automating Windows Server 2003 session yesterday evening in Reading. Hope they are useful to you.
Update static IP address
wmic nicconfig where index=9 call enablestatic("192.168.16.4"), ("255.255.255.0")
Change network gateway
wmic nicconfig where index=9 call setgateways("192.168.16.4", "192.168.16.5"),(1,2)
Enable DHCP
wmic nicconfig where index=9 call enabledhcp
Service Management
wmic service where caption="DHCP Client" call changestartmode "Disabled"
Start an application
wmic process call create "calc.exe"
Terminate an application
wmic process where name="calc.exe" call terminate
Change process priority
wmic process where name="explorer.exe" call setpriority 64
Get list of process identifiers
wmic process where (Name='svchost.exe') get name,processid
Information about harddrives
wmic logicaldisk where drivetype=3 get name, freespace, systemname, filesystem, size, volumeserialnumber
Information about os
wmic os get bootdevice, buildnumber, caption, freespaceinpagingfiles, installdate, name, systemdrive, windowsdirectory /format:htable > c:osinfo.htm
Information about files
wmic path cim_datafile where "Path='\windows\system32\wbem\' and FileSize>1784088" > c:wbemfiles.txt
Process list
wmic process get /format:htable > c:process.htm
Retrieve list of warning and error events not from system or security logs
WMIC NTEVENT WHERE "EventType<3 AND LogFile != 'System' AND LogFile != 'Security'" GET LogFile, SourceName, EventType, Message, TimeGenerated /FORMAT:"htable.xsl":" datatype = number":" sortby = EventType" > c:appevent.htm
 
还是那句话,觉得好,请留言支持.....谢谢!
本文转自许珈毓的技术思考博客51CTO博客,原文链接http://blog.51cto.com/jiayu/23942如需转载请自行联系原作者

BabyXc
相关文章
|
编译器
自制操作系统日记(一):显示hello world开始旅程
最近看了不少底层方面的东西,但还是得动手才能真正掌握,感觉操作系统也能整整了,于是就有了这系列,惯例的以hello开始
|
运维 监控 Linux
BAT大厂工程师必会Ansible,你还不来学?快来报名!
Linux训练营震撼来袭!!!本次训练营,为了帮助大家更好的掌握 Ansible ,阿里云开发者学堂联合Linux中国打造了这一门精品训练营 —— Linux 运维自动化训练营,并邀请一线工程师在线授课,帮助学生掌握 Ansible 的使用和开发。
BAT大厂工程师必会Ansible,你还不来学?快来报名!
|
Arthas Cloud Native Dubbo
Arthas 征文活动火热进行中,cherry 键盘等你来拿!(内附第三期中奖名单)
第四期征文活动将于 7 月 28 日 - 8 月 28 日举办,后续征文活动将持续至 2020 年 12 月。参与即可拿奖,欢迎大家继续踊跃投稿!
Arthas 征文活动火热进行中,cherry 键盘等你来拿!(内附第三期中奖名单)
|
Arthas Cloud Native Dubbo
Arthas 征文活动火热进行中,cherry 键盘等你来拿!(内附第一期中奖名单)
第二期征文活动将于 5 月 8 日 - 6 月 8 日举办,参与即有奖,欢迎大家继续踊跃投稿!
Arthas 征文活动火热进行中,cherry 键盘等你来拿!(内附第一期中奖名单)