菜鸟成长日记(五)之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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值