列3、顯示完整bios信息 在cmd中輸入:wmic bios get /value 加上參數(shù)value顯示更加直觀
進(jìn)程管理 列1、顯示進(jìn)程摘要信息 在cmd中輸入:wmic process list brief brief是一個參數(shù),list決定顯示的信息格式與范圍,process是別名
可用下列 LIST 格式:
列2、顯示進(jìn)程完整信息 在cmd中輸入:wmic process get
可用下列 LIST 格式: 也就是說在get后面追加下列參數(shù)如追加多個參數(shù)要用逗號隔開如:wmic process get csname,executablepath
列3、顯示某個進(jìn)程信息 在cmd中輸入:wmic process where (description="ttplayer.exe")
列4 查詢進(jìn)程的啟動路徑(將得到的信息輸出) wmic process get name,executablepath,processid wmic /output:c:/process.html process get processid,name,executablepath /format:htable
列5、結(jié)束一個進(jìn)程(可根據(jù)進(jìn)程對應(yīng)的PID) wmic process where name='outlook.exe' call terminate wmic process where name="notepad.exe" delete wmic process where name="notepad.exe" terminate wmic process where pid="123" delete wmic path win32_process where "name='notepad.exe'" delete
列出某個安裝的程序的信息 wmic product get packagename="*.msi"
刪除安裝的程序 wmic product where name="*" delete wmic product where name="騰訊qq2009" delete
查詢進(jìn)程的啟動路徑(將得到的信息輸出) wmic process get wmic /output:c:/process.html process get processid,name,executablepath /format:htable.xsl
查詢指定進(jìn)程的信息 wmic process where name="notepad.exe" get name,executablepath,processid ::name=進(jìn)程名、executablepath=路徑、processid=進(jìn)程ID
創(chuàng)造一個進(jìn)程 wmic process call create "d:/program files/ttplayer/ttplayer.exe"
在遠(yuǎn)程計算上創(chuàng)建進(jìn)程 wmic /node:192.168.8.10 /user:administrator /password:xiongyefeng process call create "c:/windows/notepad.exe"
磁盤管理
查看遠(yuǎn)程主機(jī)C盤情況 WMIC /node:"192.168.8.100" /user:"administrator" /password:"lcx" /output:a.html logicaldisk where "name='c:'" get DeviceID,Size,FreeSpace,Description,FileSystem /format:htable 其中node開關(guān)表示對哪臺機(jī)器進(jìn)行訪問,user和password當(dāng)然是遠(yuǎn)程機(jī)器的用戶名和密碼了,這個命令有了以上的講解,大家應(yīng)當(dāng)一目了然了吧。
列6、查看本機(jī)C盤情況 wmic logicaldisk where name="c:" get ::Caption=說明、 Compressed=壓縮、 CreationClassName=創(chuàng)造類名稱 Description=描述、 DeviceID=驅(qū)動器ID號 DriveType=驅(qū)動器類型、 FileSystem=文件系統(tǒng)、 FreeSpace=剩余空間、MaximumComponentLength Size=總?cè)萘俊tatus=狀態(tài)、SystemName=計算機(jī)名、VolumeName=卷標(biāo)名、VolumeSerialNumber卷標(biāo)字符串
查看磁盤的屬性 wmic logicaldisk list brief ::caption=標(biāo)題、driveID=驅(qū)動器ID號、model=產(chǎn)品型號、Partitions=分區(qū)、size=大小
查看物理磁盤的真實(shí)情況 wmic diskdrive list ::Caption說明、DeviceID=驅(qū)動器ID號、Model=原硬盤型號、 Partitions=分區(qū)總數(shù)、 Size=硬盤大小
獲得U盤的盤符號 wmic logicaldisk where drivetype='2' get deviceid,description wmic logicaldisk where "drivetype=2" get name ::2=移動磁盤、3=本地磁盤、5=光驅(qū)。
更改卷標(biāo)的名稱 wmic logicaldisk where name="c:" set volumename=lsxq ::相當(dāng)于label c: lsxq
安裝包任務(wù)管理 列1 列出安裝的程序及其它詳解信息 wmic product get ::也可加上以下參數(shù)并用豆號隔開如:wmic prduct get name,installdate,
系統(tǒng)服務(wù)管理
wmic service where name="TermService" get processid ::獲得指定服務(wù)進(jìn)程的PID號
wmic service where state='running' get name,displayname ::顯示正在運(yùn)行的服務(wù)
wmic service where state='running' get name,pathname ::顯示已啟動服務(wù)對應(yīng)所在的可執(zhí)行文件路徑
wmic service where name="sharedaccess" startservice ::啟動一個服務(wù)
wmic service where name="sharedaccess" stopservice ::停止一個服務(wù)
wmic service where name='sharedaccess' changestartmode 'automatic' ::將某個服務(wù)設(shè)為自啟動(手動、禁用)
顯示開機(jī)自啟動的服務(wù) wmic service where startmode='auto' get name,displayname :: 顯示開始自啟動并且當(dāng)前處于運(yùn)行狀態(tài)的服務(wù) wmic service where "startmode='auto' and state='running'" get name,displayname :: 顯示禁用或手動啟動的服務(wù) wmic service where 'startmode="disabled" or startmode="manual"' get name,displayname ::
全盤查找指定文件 wmic datafile where "filename='qq' and extension='exe'" get name
獲得指定路徑下特定擴(kuò)展名并要求只顯示滿足題目條件的文件 wmic datafile where "drive='e:' and path='//surecity//' and extension='rar' and filesize>1000" get name
獲取文件的創(chuàng)建、訪問、修改時間 Wmic datafile where name="c://windows//notepad.exe" get CreationDate,LastAccessed,LastModified ::createiondate=創(chuàng)建、LastAccessed=最后訪問時間、LastModifie=最后修改時間
壓縮指定文件夾,以便節(jié)省磁盤空間 wmic fsdir where (name='d://test') call compress ::壓縮D盤的test文件夾,并以藍(lán)色的字體突出顯示
解壓縮指定文件夾 wmic fsdir where (name='d://test') call compress ::解壓縮D盤的test文件夾,并以恢復(fù)正常的字體
別名的用法及實(shí)例
別名 job wmic job call create "sol.exe",0,0,1,0,********154600.000000+480 :: Os 別名
wmic os Where (primary='1') call win32shutdown * 這個*參數(shù)可以有如下值: Const LOGOFF=0 Const SHUTDOWN=1 Const REBOOT=2 Const FORCE=4 Const POWEROFF=8
要求需要有管理員權(quán)限 wmic os where(primary=1) call setdatetime 20120731144642.555555+480 ::更改時間為2010年7月31號14點(diǎn)46分42秒
用來設(shè)置程序的優(yōu)先權(quán) wmic process 2556 call setpriority 64
64 Idle 優(yōu)先權(quán)–低 16384 Below Normal 優(yōu)先權(quán)–低于標(biāo)準(zhǔn) 32 Normal 優(yōu)先權(quán)–標(biāo)準(zhǔn) 32768 Above Normal 優(yōu)先權(quán)–高于標(biāo)準(zhǔn) 128 High Priority 優(yōu)先權(quán)–高 256 Real Time 優(yōu)先權(quán)–實(shí)時