|
|
Win2003 下常用的几个新行命令 5 c8 w+ C- j5 @0 d) Z9 W0 U6 Z8 I
" ?2 r3 F' Y- v5 f) U' V7 [
Windows2003的cmd.exe比以前的windiws系统的cmd添加了60多个新的行命令,功能强大,方便多多;使得在命令行下对系统的管理更为方便。下面就我个人认为常用的几个行命令作以简介,更详细的用法请参见系统的帮助。3 {+ z2 X8 v8 M9 {0 Y- `: _) Q1 C/ U
1。clip 将行命令的输出导入系统剪贴板
5 i6 W: f& a4 R 省去了选择和拷贝命令输出这两步。
6 b- V* n1 P4 y8 @" c) r; Z如: dir|clip
$ G; b2 P* a6 T- I: |8 a可以将dir的结果导入系统剪贴板,并在可在notepad等文本编辑器中用Ctrl+V粘贴结果。
$ \) ^' b+ Q6 P- L0 v clip<test.txt9 m) W. y! g: J/ Z
这样就不用打开test.txt文件,而是直接将test.txt的内容导入剪贴板。! ]6 ?0 E8 S5 x0 _
2。bootcfg 查询、配置、修改本地和远程机上的boot.ini文件
9 o/ {) w) V3 r& M7 g& i 参数太多,不细讲。
8 s- m4 s- |5 Q" k; O* z. R6 P3。inuse 替换被锁住的操作系统的系统文件。重新启动才生效。
2 G! W5 |7 ?! x6 M v& M用法: inuse 替换文件 被替换文件 [/y]5 x& k8 t% O' `: q7 a
如: batch.cmd
- d4 ]' l; z3 p1 m$ S) ^! {2 Z @echo off
% y9 A, W5 n R! b2 ~, |+ f; X2 i inuse test.dll c:\windows\system32\test.dll /y+ [5 V7 h! f" O0 Z8 W5 v+ u( A
inuse test2.dll c:\windows\system32\test2.dll /y
) i$ B( q3 l# C2 O/ n$ x inuse test3.dll c:\windows\system32\test3.dll /y
. C# G5 M3 s# ]7 }! ] K shutdown /l /r /y
& E3 m5 h! H* E1 \) K5 k用远程文件替换本机文件:
+ h6 U, H' v5 O6 m7 u0 E' Q inuse \\srvmain\windows\test.dll c:\windows\test.dll
. O, l1 C/ c3 q: X! z: _4。systeminfo 显示机器的系统信息,如:操作系统及其配置,产品ID,硬件属性等。
) D1 s0 a+ q, i& V1 q用法:systeminfo [/s Computer ][/u Domain\UserName ][/p Password]]] [/fo {TABLE | LIST | CSV}] [/nh]$ U# A# G$ a/ Q1 H
下面是本机的systeminfo的结果:( D4 M7 m" i2 O8 ?( v
Host Name: xxx$ o. }; g! \/ n4 g7 q1 o
OS Name: Microsoft(R) Windows(R) Server 2003, Standard Edition6 m) \8 ]- Q+ a2 j; l! D( g, ~
OS Version: 5.2.3790 Build 3790
# \) A a( E1 F* E! R$ q5 zOS Manufacturer: Microsoft Corporation/ L5 a7 }. {3 V/ P+ `2 D2 k6 A* g" y
OS Configuration: Member Server6 e! | w3 p) w( H" W
OS Build Type: Uniprocessor Free) G2 s5 e( x, I1 i9 t- G
Registered Owner: xxx
* D% h$ N6 {4 p! JRegistered Organization: yy' |; M# V! U5 A3 c
Product ID: 69712-640-0592892-45260( z) l' X- k, G. W" L
Original Install Date: 2003-8-17, 0:02:07
0 d0 E6 X: U, l+ D& _' N5 QSystem Up Time: 1 Days, 11 Hours, 58 Minutes, 15 Seconds e; q! n- [) x8 ^3 P+ P; G/ g# V% @
System Manufacturer: VIA Technologies, Inc.. i% v* n; o. Z8 m5 z% ], T
System Model: VT82C692BX, I8 c* {* P- }; Z$ T
System Type: X86-based PC$ P, W& b" D; G! d9 H
Processor(s): 1 Processor(s) Installed./ h0 z6 C% I" M
[01]: x86 Family 6 Model 7 Stepping 3 GenuineIntel ~501 Mhz# e" F5 Z# ]: i& z. _/ a" \! j3 q
BIOS Version: SOYO - 42302e31
8 |% c2 i% U7 V$ FWindows Directory: c:\WINDOWS [& [" U& f/ m- R5 d0 v
System Directory: c:\WINDOWS\system32
" [. c+ h) q; o" e4 r" I; `Boot Device: \Device\HarddiskVolume16 x/ u2 Z4 v. }2 q y$ F8 h
System Locale: zh-cn;Chinese (China)% c. P; I O1 ~; P* [% Z
Input Locale: en-us;English (United States)
$ g5 X2 E3 a' {+ s8 U) xTime Zone: (GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi
o+ a8 i! P# Y) ^, KTotal Physical Memory: 639 MB
8 z- O* y5 n- L M5 `! lAvailable Physical Memory: 327 MB$ m( k0 @. t" [; f1 E5 Z
Page File: Max Size: 2,205 MB, U5 A# X/ o E2 P
Page File: Available: 1,608 MB
. E8 {3 }6 q# |8 n& pPage File: In Use: 597 MB* T5 o/ Y2 X+ T: l( f
Page File Location(s): c:\pagefile.sys
% P1 A8 S6 m( K% R1 e6 H( QDomain: dd.cc.bb.cn7 L& f$ w I3 [9 c8 U
Logon Server: \\SERVER-dd
8 Q3 O w6 l5 S7 f: nHotfix(s): 3 Hotfix(s) Installed.
r! _4 Z$ n5 f, |* W. P2 r [01]: File 1
3 L* v5 g' S" R1 g* I3 [8 M [02]: Q147222" w2 x6 y2 G9 }- i
[03]: KB823980 - Update
9 [6 a6 z' A, o. n2 nNetwork Card(s): 1 NIC(s) Installed.+ N9 H: U& \! }( x( ]2 Z
5。taskkill 结束任务和进程。许多在图形界面的任务管理器不能结束的任务和进程,它都可以完成。常和tasklist配合使用。 N# F& p+ X6 V
用法:taskkill [/s Computer] [/u Domain\UserName ][/p Password]] {/fi FilterName [{/pid ProcessID | /im ImageName}] | /pid ProcessID | /im ImageName} [/f] [/t]
5 p0 m, E8 ^3 g4 }" [/ [' [ 最近的冲击波病毒等就靠它杀死的,很有用!!!以前taskkill叫kill,不过当时系统不自带,是在Resource Kit里。4 g( ]( ?7 E! I A3 B$ `* ?' ~
6。tasklist 显示正在运行的进程
8 ~/ M& c' g I1 i$ Q e3 C6 J用法:tasklist[.exe] [/s Computer] [/u Domain\User ][/p Password]] [{/m Module | /svc | /v}] [/fo {TABLE | LIST | CSV}] [/nh] [/fi FilterName ][/fi FilterName2 ][ ... ]]]
4 a3 L* E0 x' K# A# P7。where 显示所查找的文件或者目录的位置(在where德当前位置和系统path环境变量所声明的路径里,可以用同配符*,?)。这里的一个大虾在这win2003以前也写了个同名同功能的批处理文件,我用过,很棒。可以起诉微软了!哈哈!!
3 v: ]( t: _) N1 e: J& W用法:where [/r Dir] [/q] [/f] [/t] Pattern ...: u$ `& K/ Q2 s$ Q3 d) y4 ?
如: where "program files"! E' C" l/ e3 [
where /r c:\ test
. T' [ c+ m. T# t+ |* T2 p6 \6 j where /r \\computer1\c /e notepad.*7 G* e) E2 d( [5 ]
8。whoami 查询域名、计算机名、用户名、组名、登陆identifier以及当前用户的权限。$ o" z2 Q- E$ L# L# o5 G+ Z
如:whoami /all
; M! h: v2 E2 C; f
' J; M1 L4 } l+ Z q. | |
|