列3、顯示完整bios信息 在cmd中輸入:wmic bios get /value 加上參數(shù)value顯示更加直觀
進(jìn)程管理 列1、顯示進(jìn)程摘要信息 在cmd中輸入:wmic process list brief brief是一個(gè)參數(shù),list決定顯示的信息格式與范圍,process是別名
可用下列 LIST 格式:
列2、顯示進(jìn)程完整信息 在cmd中輸入:wmic process get
可用下列 LIST 格式: 也就是說(shuō)在get后面追加下列參數(shù)如追加多個(gè)參數(shù)要用逗號(hào)隔開(kāi)如:wmic process get csname,executablepath
列3、顯示某個(gè)進(jìn)程信息 在cmd中輸入:wmic process where (description="ttplayer.exe")
列4 查詢進(jìn)程的啟動(dòng)路徑(將得到的信息輸出) wmic process get name,executablepath,processid wmic /output:c:/process.html process get processid,name,executablepath /format:htable
列5、結(jié)束一個(gè)進(jìn)程(可根據(jù)進(jìn)程對(duì)應(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
列出某個(gè)安裝的程序的信息 wmic product get packagename="*.msi"
刪除安裝的程序 wmic product where name="*" delete wmic product where name="騰訊qq2009" delete
查詢進(jìn)程的啟動(dòng)路徑(將得到的信息輸出) 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)造一個(gè)進(jìn)程 wmic process call create "d:/program files/ttplayer/ttplayer.exe"
在遠(yuǎn)程計(jì)算上創(chuàng)建進(jìn)程 wmic /node:192.168.8.10 /user:administrator /password:xiongyefeng process call create "c:/windows/notepad.exe"
磁盤(pán)管理
查看遠(yuǎn)程主機(jī)C盤(pán)情況 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開(kāi)關(guān)表示對(duì)哪臺(tái)機(jī)器進(jìn)行訪問(wèn),user和password當(dāng)然是遠(yuǎn)程機(jī)器的用戶名和密碼了,這個(gè)命令有了以上的講解,大家應(yīng)當(dāng)一目了然了吧。
列6、查看本機(jī)C盤(pán)情況 wmic logicaldisk where name="c:" get ::Caption=說(shuō)明、 Compressed=壓縮、 CreationClassName=創(chuàng)造類名稱 Description=描述、 DeviceID=驅(qū)動(dòng)器ID號(hào) DriveType=驅(qū)動(dòng)器類型、 FileSystem=文件系統(tǒng)、 FreeSpace=剩余空間、MaximumComponentLength Size=總?cè)萘俊tatus=狀態(tài)、SystemName=計(jì)算機(jī)名、VolumeName=卷標(biāo)名、VolumeSerialNumber卷標(biāo)字符串
查看磁盤(pán)的屬性 wmic logicaldisk list brief ::caption=標(biāo)題、driveID=驅(qū)動(dòng)器ID號(hào)、model=產(chǎn)品型號(hào)、Partitions=分區(qū)、size=大小
查看物理磁盤(pán)的真實(shí)情況 wmic diskdrive list ::Caption說(shuō)明、DeviceID=驅(qū)動(dòng)器ID號(hào)、Model=原硬盤(pán)型號(hào)、 Partitions=分區(qū)總數(shù)、 Size=硬盤(pán)大小
獲得U盤(pán)的盤(pán)符號(hào) wmic logicaldisk where drivetype='2' get deviceid,description wmic logicaldisk where "drivetype=2" get name ::2=移動(dòng)磁盤(pán)、3=本地磁盤(pán)、5=光驅(qū)。
更改卷標(biāo)的名稱 wmic logicaldisk where name="c:" set volumename=lsxq ::相當(dāng)于label c: lsxq
安裝包任務(wù)管理 列1 列出安裝的程序及其它詳解信息 wmic product get ::也可加上以下參數(shù)并用豆號(hào)隔開(kāi)如:wmic prduct get name,installdate,
系統(tǒng)服務(wù)管理
wmic service where name="TermService" get processid ::獲得指定服務(wù)進(jìn)程的PID號(hào)
wmic service where state='running' get name,displayname ::顯示正在運(yùn)行的服務(wù)
wmic service where state='running' get name,pathname ::顯示已啟動(dòng)服務(wù)對(duì)應(yīng)所在的可執(zhí)行文件路徑
wmic service where name="sharedaccess" startservice ::啟動(dòng)一個(gè)服務(wù)
wmic service where name="sharedaccess" stopservice ::停止一個(gè)服務(wù)
wmic service where name='sharedaccess' changestartmode 'automatic' ::將某個(gè)服務(wù)設(shè)為自啟動(dòng)(手動(dòng)、禁用)
顯示開(kāi)機(jī)自啟動(dòng)的服務(wù) wmic service where startmode='auto' get name,displayname :: 顯示開(kāi)始自啟動(dòng)并且當(dāng)前處于運(yùn)行狀態(tài)的服務(wù) wmic service where "startmode='auto' and state='running'" get name,displayname :: 顯示禁用或手動(dòng)啟動(dòng)的服務(wù) wmic service where 'startmode="disabled" or startmode="manual"' get name,displayname ::
全盤(pán)查找指定文件 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)建、訪問(wèn)、修改時(shí)間 Wmic datafile where name="c://windows//notepad.exe" get CreationDate,LastAccessed,LastModified ::createiondate=創(chuàng)建、LastAccessed=最后訪問(wèn)時(shí)間、LastModifie=最后修改時(shí)間
壓縮指定文件夾,以便節(jié)省磁盤(pán)空間 wmic fsdir where (name='d://test') call compress ::壓縮D盤(pán)的test文件夾,并以藍(lán)色的字體突出顯示
解壓縮指定文件夾 wmic fsdir where (name='d://test') call compress ::解壓縮D盤(pán)的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 * 這個(gè)*參數(shù)可以有如下值: Const LOGOFF=0 Const SHUTDOWN=1 Const REBOOT=2 Const FORCE=4 Const POWEROFF=8