注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 小五思科技术学习笔记之SSH
 帮助

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


2007-04-17 05:15:23
版权声明:原创作品,如需转载,请与作者联系。否则将追究法律责任。
       晚上,睡不着.帮大家收集整理了些.关于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
 
还是那句话,觉得好,请留言支持.....谢谢!

本文出自 “世界因你而不同” 博客,转载请与作者联系!





    文章评论
 
2007-04-17 10:18:26
哈哈   坐沙发   爽

2007-04-17 10:30:21
抓到一只夜猫子!

2007-04-17 10:59:18
楼主辛苦了!!

2007-04-17 12:05:24
希望LZ再辛苦点!吃得苦中苦方为人上人啊

2007-04-17 14:58:47
我机器的WMIC
为什么无法用PROCESS查询进程
显示(错误:
    代码 = 0x80041001
      说明 = 通用故障
    设备 = WMI)

2007-04-17 16:24:05
看过,顶过,没用过

2007-04-18 14:57:17
支持支持再支持

2007-04-18 22:09:23
顶,博主再接再励。。

2007-04-25 11:14:56
我也是刚刚接触WMIC的菜菜,在网上找教程,谢谢你写了这些,顶!顶!

2007-06-04 15:31:14
大开眼界。继续努力。

2008-02-22 19:55:55
不错,顶\下!

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: