菜鸟成长日记(五)之WMIC简单命令应用
生活随笔
收集整理的這篇文章主要介紹了
菜鸟成长日记(五)之WMIC简单命令应用
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
晚上,睡不著.幫大家收集整理了些.關(guān)于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 還是那句話,覺得好,請留言支持.....謝謝!
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 還是那句話,覺得好,請留言支持.....謝謝!
總結(jié)
以上是生活随笔為你收集整理的菜鸟成长日记(五)之WMIC简单命令应用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 信媒体还是信观众?《蚁人3》烂番茄观众指
- 下一篇: [转]Velocity脚本摘要