Windows2003的cmd.exe比以前的windiws系統(tǒng)的cmd添加了60多個新的行命令,功能強大,方便多多;使得在命令行下對系統(tǒng)的管理更為方便。下面就我個人認(rèn)為常用的幾個行命令作以簡介,更詳細(xì)的用法請參見系統(tǒng)的幫助。
1。clip 將行命令的輸出導(dǎo)入系統(tǒng)剪貼板
省去了選擇和拷貝命令輸出這兩步。
如: dir|clip
可以將dir的結(jié)果導(dǎo)入系統(tǒng)剪貼板,并在可在notepad等文本編輯器中用Ctrl+V粘貼結(jié)果。
clip<>
這樣就不用打開test.txt文件,而是直接將test.txt的內(nèi)容導(dǎo)入剪貼板。
2。bootcfg 查詢、配置、修改本地和遠(yuǎn)程機(jī)上的boot.ini文件
參數(shù)太多,不細(xì)講。
3。inuse 替換被鎖住的操作系統(tǒng)的系統(tǒng)文件。重新啟動才生效。
用法: 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
用遠(yuǎn)程文件替換本機(jī)文件:
inuse \\srvmain\windows\test.dll c:\windows\test.dll
4。systeminfo 顯示機(jī)器的系統(tǒng)信息,如:操作系統(tǒng)及其配置,產(chǎn)品ID,硬件屬性等。
用法:systeminfo [/s Computer ][/u Domain\UserName ][/p Password]]] [/fo {TABLE | LIST | CSV}] [/nh]
下面是本機(jī)的systeminfo的結(jié)果:
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 結(jié)束任務(wù)和進(jìn)程。許多在圖形界面的任務(wù)管理器不能結(jié)束的任務(wù)和進(jìn)程,它都可以完成。常和tasklist配合使用。
用法:taskkill [/s Computer] [/u Domain\UserName ][/p Password]] {/fi FilterName [{/pid ProcessID | /im ImageName}] | /pid ProcessID | /im ImageName} [/f] [/t]
最近的沖擊波病毒等就*它殺死的,很有用!?。∫郧皌askkill叫kill,不過當(dāng)時系統(tǒng)不自帶,是在Resource Kit里。
6。tasklist 顯示正在運行的進(jìn)程
用法: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德當(dāng)前位置和系統(tǒng)path環(huán)境變量所聲明的路徑里,可以用同配符*,?)。這里的一個大蝦在這win2003以前也寫了個同名同功能的批處理文件,我用過,很棒??梢云鹪V微軟了!哈哈!!
用法:where [/r Dir] [/q] [/f] [/t] Pattern ...
如: where 'program files'
where /r c:\ test
where /r \\computer1\c /e notepad.*
8。whoami 查詢域名、計算機(jī)名、用戶名、組名、登陸identifier以及當(dāng)前用戶的權(quán)限。
如:whoami /all
弈安傳媒科技微課堂,每天分享財經(jīng)資訊,計算機(jī)技術(shù)知識,人生感悟,創(chuàng)業(yè)指導(dǎo)以及各種專業(yè)技術(shù)知識資料學(xué)習(xí)交流.移動學(xué)習(xí)平臺、知識分享平臺。隨時隨地的學(xué)習(xí),如果你喜歡成長,這里你不容錯過的地方.弈安傳媒科技培訓(xùn)關(guān)注:關(guān)注自己成長,分享內(nèi)容,分享自己的技術(shù),成就未來.
[弈安傳媒科技提升自己的平臺]請關(guān)注:頭條號及公眾號 弈安傳媒科技