|
|
Win2003 下常用的几个新行命令 : W% \; i2 E9 k# E9 l9 H
8 T! ]: g$ `- @1 _: T4 ~5 H
Windows2003的cmd.exe比以前的windiws系统的cmd添加了60多个新的行命令,功能强大,方便多多;使得在命令行下对系统的管理更为方便。下面就我个人认为常用的几个行命令作以简介,更详细的用法请参见系统的帮助。7 X Y0 s; Q" ^; ~, {
1。clip 将行命令的输出导入系统剪贴板
% c0 { z* t% x3 q" d6 I+ F! H 省去了选择和拷贝命令输出这两步。" b. x1 m# Z6 ^; `) r b( E. [) M
如: dir|clip9 p; X! m! a E& r
可以将dir的结果导入系统剪贴板,并在可在notepad等文本编辑器中用Ctrl+V粘贴结果。
* d% S, U. O8 u1 h clip<test.txt- f% ^/ j2 H, @; h9 B7 @5 @
这样就不用打开test.txt文件,而是直接将test.txt的内容导入剪贴板。) _; R" X$ C6 w( X# k3 h- Y1 `' [# v
2。bootcfg 查询、配置、修改本地和远程机上的boot.ini文件
0 k0 _' J' G) E( i" B( ^5 W! T7 w: E 参数太多,不细讲。
* m" a5 g- V2 [% Q" L3。inuse 替换被锁住的操作系统的系统文件。重新启动才生效。
* Q6 c+ }4 V" ?* c8 i用法: inuse 替换文件 被替换文件 [/y]
% E: q% m, V/ `* y如: batch.cmd, k/ ^- N8 r2 s6 Q
@echo off
# K- G4 p. o; D# x0 V: @3 j& X inuse test.dll c:\windows\system32\test.dll /y
% ?: Y% ]( G4 e/ L3 S inuse test2.dll c:\windows\system32\test2.dll /y
- K0 \& X7 u7 t$ W5 Z- ? inuse test3.dll c:\windows\system32\test3.dll /y
) K) A. M% d m) L1 X- z1 D shutdown /l /r /y5 N0 w/ \2 Q6 m' [' V/ [
用远程文件替换本机文件:
- }9 q- p) `/ G+ ^! o% _ inuse \\srvmain\windows\test.dll c:\windows\test.dll) m% R# R5 v) V% O# k3 r$ z. e% G
4。systeminfo 显示机器的系统信息,如:操作系统及其配置,产品ID,硬件属性等。
6 _5 D+ y. r; m2 G用法:systeminfo [/s Computer ][/u Domain\UserName ][/p Password]]] [/fo {TABLE | LIST | CSV}] [/nh]" h ?7 T% Q! A {; O: p$ }+ ~6 D) \
下面是本机的systeminfo的结果:
6 B7 I" W+ U" g- qHost Name: xxx( W9 ~3 A, {0 m
OS Name: Microsoft(R) Windows(R) Server 2003, Standard Edition
7 G! p8 L$ }2 E1 f- q! rOS Version: 5.2.3790 Build 3790
9 T ^9 a% j; x( z4 `OS Manufacturer: Microsoft Corporation- J/ h6 z( T0 U( R) W9 r. z
OS Configuration: Member Server- Q8 N% I7 B8 t7 I$ |, y
OS Build Type: Uniprocessor Free1 h, k s4 r7 e3 t2 [# Q
Registered Owner: xxx/ j, v. L6 H; b. E
Registered Organization: yy6 N/ f, e7 p' \4 ^5 I* e1 i( ]
Product ID: 69712-640-0592892-45260
0 B$ X6 G5 r2 _: r3 i) L0 ?( nOriginal Install Date: 2003-8-17, 0:02:07
7 n2 J: S5 [+ c1 `: U7 O* uSystem Up Time: 1 Days, 11 Hours, 58 Minutes, 15 Seconds
4 x& S; t% N; W" z/ k# S bSystem Manufacturer: VIA Technologies, Inc.9 a2 S2 Z" r8 ?3 I; k+ w
System Model: VT82C692BX
/ g( m( o8 ~6 L/ L$ M& f9 G5 s4 ESystem Type: X86-based PC- F8 \7 B f* s8 X' _' H7 a# x! u
Processor(s): 1 Processor(s) Installed.
- H Q! V8 N' i [01]: x86 Family 6 Model 7 Stepping 3 GenuineIntel ~501 Mhz2 a/ V8 u* ~' f& ]
BIOS Version: SOYO - 42302e315 f9 y W1 L* _* i
Windows Directory: c:\WINDOWS" e8 m; W0 x' k/ P
System Directory: c:\WINDOWS\system32* F9 v( Z+ ]4 _2 M/ m9 D
Boot Device: \Device\HarddiskVolume16 B j; O/ F: w! ?* D
System Locale: zh-cn;Chinese (China)
! a$ y' ]3 B0 X4 l0 d; T( c9 SInput Locale: en-us;English (United States)
2 `, [% w9 z& \2 L$ U9 V% oTime Zone: (GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi
8 {8 V& k8 T2 L& kTotal Physical Memory: 639 MB
! C% x8 X8 Y( N" O/ RAvailable Physical Memory: 327 MB
9 m, | R4 J& b7 m. { i Z5 sPage File: Max Size: 2,205 MB( D- G' r$ Q1 Y! N9 z2 ]# s. N+ R1 H
Page File: Available: 1,608 MB
1 `' y5 G7 X. G1 u, I2 y9 [5 O. T( XPage File: In Use: 597 MB
& g* s( Z! Y6 f. s% M% ^Page File Location(s): c:\pagefile.sys
% A- ^* ~( |' q) Q( eDomain: dd.cc.bb.cn8 i# v& f+ B- t
Logon Server: \\SERVER-dd0 M* c! E2 W- ?4 V
Hotfix(s): 3 Hotfix(s) Installed.1 R- [1 q( M- M0 {+ [# ]' ^
[01]: File 1: J, E c; C! t1 v0 k1 N. E
[02]: Q147222
9 W& L6 Y2 c7 D% Q, c+ B/ I [03]: KB823980 - Update3 J# V, ]6 `! T" Q) ^3 ?
Network Card(s): 1 NIC(s) Installed.: J0 C m" t2 D2 Z, Q" K& T: b
5。taskkill 结束任务和进程。许多在图形界面的任务管理器不能结束的任务和进程,它都可以完成。常和tasklist配合使用。
* s! w0 L2 l# b: i# s X用法:taskkill [/s Computer] [/u Domain\UserName ][/p Password]] {/fi FilterName [{/pid ProcessID | /im ImageName}] | /pid ProcessID | /im ImageName} [/f] [/t]
& N' Q& |8 Q" C* T4 q1 { 最近的冲击波病毒等就靠它杀死的,很有用!!!以前taskkill叫kill,不过当时系统不自带,是在Resource Kit里。& N* Q9 d4 ?$ N7 N, Q$ n
6。tasklist 显示正在运行的进程
! \5 s3 [ t6 y- [0 M5 e用法:tasklist[.exe] [/s Computer] [/u Domain\User ][/p Password]] [{/m Module | /svc | /v}] [/fo {TABLE | LIST | CSV}] [/nh] [/fi FilterName ][/fi FilterName2 ][ ... ]]] 5 L7 |" \* ]% B2 V$ w% u
7。where 显示所查找的文件或者目录的位置(在where德当前位置和系统path环境变量所声明的路径里,可以用同配符*,?)。这里的一个大虾在这win2003以前也写了个同名同功能的批处理文件,我用过,很棒。可以起诉微软了!哈哈!!
! |: Q6 }2 ]: v+ l0 T, B0 u用法:where [/r Dir] [/q] [/f] [/t] Pattern ...
& n, W/ F0 c5 C0 T5 J如: where "program files"
9 |& |" y/ _3 G: w& f where /r c:\ test
: B6 Q% v0 F m: `* L where /r \\computer1\c /e notepad.*
7 p o1 q/ P! L& i; ~' ~8。whoami 查询域名、计算机名、用户名、组名、登陆identifier以及当前用户的权限。
$ U) j ^$ z: B( j* m8 K如:whoami /all 8 d2 N( p4 v5 R8 u
, _4 r6 G6 R$ |
|
|