Windows2003的cmd.exe比以前的windiws系统的cmd添加了60多个新的行命令,功能强大,方便多多;使得在命令行下对系统的管理更为方便。下面就我个人认为常用的几个行命令作以简介,更详细的用法请参见系统的帮助。 1。clip 将行命令的输出导入系统剪贴板 省去了选择和拷贝命令输出这两步。 如: dir|clip 可以将dir的结果导入系统剪贴板,并在可在notepad等文本编辑器中用Ctrl+V粘贴结果。 clip 这样就不用打开test.txt文件,而是直接将test.txt的内容导入剪贴板。 2。bootcfg 查询、配置、修改本地和远程机上的boot.ini文件 参数太多,不细讲。 3。inuse 替换被锁住的操作系统的系统文件。重新启动才生效。 用法: inuse 替换文件 被替换文件 [/y] 如: 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 [/s Computer ][/u Domain\UserName ][/p Password]]] [/fo {TABLE | LIST | CSV}] [/nh] 下面是本机的systeminfo的结果: Host Name: *** 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. [01]: 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. [01]: File 1 [02]: Q147222 [03]: KB823980 - Update Network Card(s): 1 NIC(s) Installed. 5。taskkill 结束任务和进程。许多在图形界面的任务管理器不能结束的任务和进程,它都可以完成。常和tasklist配合使用。 用法:taskkill [/s Computer] [/u Domain\UserName ][/p Password]] {/fi FilterName [{/pid ProcessID | /im ImageName}] | /pid ProcessID | /im ImageName} [/f] [/t] 最近的冲击波病毒等就*它杀死的,很有用!!!以前taskkill叫kill,不过当时系统不自带,是在Resource Kit里。 6。tasklist 显示正在运行的进程 用法:tasklist[.exe] [/s Computer] [/u Domain\User ][/p Password]] [{/m Module | /svc | /v}] [/fo {TABLE | LIST | CSV}] [/nh] [/fi FilterName ][/fi FilterName2 ][ ... ]]] 7。where 显示所查找的文件或者目录的位置(在where德当前位置和系统path环境变量所声明的路径里,可以用同配符*,?)。这里的一个大虾在这win2003以前也写了个同名同功能的批处理文件,我用过,很棒。可以起诉微软了!哈哈!! 用法:where [/r Dir] [/q] [/f] [/t] Pattern ... 如: where 'program files' where /r c:\ test where /r \\computer1\c /e notepad.* 8。whoami 查询域名、计算机名、用户名、组名、登陆identifier以及当前用户的权限。 如:whoami /all 弈安传媒科技微课堂,每天分享财经资讯,计算机技术知识,人生感悟,创业指导以及各种专业技术知识资料学习交流.移动学习平台、知识分享平台。随时随地的学习,如果你喜欢成长,这里你不容错过的地方.弈安传媒科技培训关注:关注自己成长,分享内容,分享自己的技术,成就未来. [弈安传媒科技提升自己的平台]请关注:头条号及公众号 弈安传媒科技 |
|