cgr3033 发表于 2003-9-18 13:21:18

Win2003 下常用的几个新行命令

Win2003 下常用的几个新行命令

    Windows2003的cmd.exe比以前的windiws系统的cmd添加了60多个新的行命令,功能强大,方便多多;使得在命令行下对系统的管理更为方便。下面就我个人认为常用的几个行命令作以简介,更详细的用法请参见系统的帮助。
1。clip 将行命令的输出导入系统剪贴板
    省去了选择和拷贝命令输出这两步。
如:    dir|clip
可以将dir的结果导入系统剪贴板,并在可在notepad等文本编辑器中用Ctrl+V粘贴结果。
    clip<test.txt
这样就不用打开test.txt文件,而是直接将test.txt的内容导入剪贴板。
2。bootcfg 查询、配置、修改本地和远程机上的boot.ini文件
    参数太多,不细讲。
3。inuse 替换被锁住的操作系统的系统文件。重新启动才生效。
用法:    inuse 替换文件 被替换文件
如:       batch.cmd
       @echo off
       inuse test.dll c:\windows\system32\test.dll /y
       inuse test2.dll c:\windows\system32\test2.dll /y
       inuse test3.dll c:\windows\system32\test3.dll /y
       shutdown /l /r /y
用远程文件替换本机文件:
    inuse \\srvmain\windows\test.dll c:\windows\test.dll
4。systeminfo 显示机器的系统信息,如:操作系统及其配置,产品ID,硬件属性等。
用法:systeminfo ]]
下面是本机的systeminfo的结果:
Host Name:               xxx
OS Name:                   Microsoft(R) Windows(R) Server 2003, Standard Edition
OS Version:                5.2.3790 Build 3790
OS Manufacturer:         Microsoft Corporation
OS Configuration:          Member Server
OS Build Type:             Uniprocessor Free
Registered Owner:          xxx
Registered Organization:   yy
Product ID:                69712-640-0592892-45260
Original Install Date:   2003-8-17, 0:02:07
System Up Time:            1 Days, 11 Hours, 58 Minutes, 15 Seconds
System Manufacturer:       VIA Technologies, Inc.
System Model:            VT82C692BX
System Type:               X86-based PC
Processor(s):            1 Processor(s) Installed.
                           : x86 Family 6 Model 7 Stepping 3 GenuineIntel ~501 Mhz
BIOS Version:            SOYO   - 42302e31
Windows Directory:      c:\WINDOWS
System Directory:          c:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             zh-cn;Chinese (China)
Input Locale:            en-us;English (United States)
Time Zone:               (GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi
Total Physical Memory:   639 MB
Available Physical Memory: 327 MB
Page File: Max Size:       2,205 MB
Page File: Available:      1,608 MB
Page File: In Use:         597 MB
Page File Location(s):   c:\pagefile.sys
Domain:                  dd.cc.bb.cn
Logon Server:            \\SERVER-dd
Hotfix(s):               3 Hotfix(s) Installed.
                           : File 1
                           : Q147222
                           : KB823980 - Update
Network Card(s):         1 NIC(s) Installed.
5。taskkill 结束任务和进程。许多在图形界面的任务管理器不能结束的任务和进程,它都可以完成。常和tasklist配合使用。
用法:taskkill ] {/fi FilterName [{/pid ProcessID | /im   ImageName}] | /pid ProcessID | /im ImageName}
    最近的冲击波病毒等就靠它杀死的,很有用!!!以前taskkill叫kill,不过当时系统不自带,是在Resource Kit里。
6。tasklist 显示正在运行的进程
用法:tasklist[.exe] ] [{/m Module | /svc | /v}] [ ... ]]]
7。where 显示所查找的文件或者目录的位置(在where德当前位置和系统path环境变量所声明的路径里,可以用同配符*,?)。这里的一个大虾在这win2003以前也写了个同名同功能的批处理文件,我用过,很棒。可以起诉微软了!哈哈!!
用法:where Pattern ...
如:    where "program files"
    where /r c:\ test
    where /r \\computer1\c /e notepad.*
8。whoami 查询域名、计算机名、用户名、组名、登陆identifier以及当前用户的权限。
如:whoami /all

页: [1]
查看完整版本: Win2003 下常用的几个新行命令