比CMD更強大的命令列WMIC

2021-07-03 04:02:18 字數 3024 閱讀 2606

先決條件:

a. 啟動windows management instrumentation服務,開放tcp135埠。

b. 本地安全策略的「網路訪問: 本地帳戶的共享和安全模式」應設為「經典-本地使用者以自己的身份驗證」。

1. wmic /node:"192.168.1.20" /user:"domain\administrator" /password:"123456"

2.【硬體管理】:

獲取磁碟資料:

wmic diskdrive get deviceid,caption,size,inte***cetype

獲取分割槽資料:

wmic logicaldisk get name,description,filesystem,size,freespace

獲取cpu資料:

wmic cpu get name,addresswidth,processorid

獲取主機板資料:

wmic baseboard get manufacturer,product,version,serialnumber

獲取記憶體數:

wmic memlogical get totalphysicalmemory

獲得品牌機的序列號:

wmic csproduct get identifyingnumber

獲取音效卡資料:

wmic sounddev get productname

獲取螢幕解析度

wmic desktopmonitor where status='ok' get screenheight,screenwidth

3. process【程序管理】:

列出程序

wmic process list brief

(full顯示所有、brief顯示摘要、instance顯示例項、status顯示狀態)

wmic 獲取程序路徑:

wmic process where name="jqs.exe" get executablepath

wmic 建立新程序

wmic process call create notepad

wmic process call create "c:\program files\tencent\qq\qq.exe"

wmic process call create "shutdown.exe -r -f -t 20"

wmic 刪除指定程序:

wmic process where name="qq.exe" call terminate

wmic process where processid="2345" delete

wmic process 2345 call terminate

wmic 刪除可疑程序

wmic process where "name='explorer.exe' and executablepath<>'%systemdrive%\\windows\\explorer.exe'" delete

wmic process where "name='svchost.exe' and executablepath<>'c:\\windows\\system32\\svchost.exe'" call terminate

3. useraccount【賬號管理】:

更改當前使用者名稱

wmic useraccount where "name='%username%'" call rename newusername

wmic useraccount create /?

4. share【共享管理】:

建立共享

wmic share call create "","test","3","testsharename","","c:\test",0

(可使用 wmic share call create /? 檢視create後的引數型別)

刪除共享

wmic share where name="c$" call delete

wmic share where path='c:\\test' delete

5. service【服務管理】:

更改telnet服務啟動型別[auto|disabled|manual]

wmic service where name="tlntsvr" set startmode="auto"

執行telnet服務

wmic service where name="tlntsvr" call startservice

停止ics服務

wmic service where name="shardaccess" call stopservice

刪除test服務

wmic service where name="test" call delete

6. fsdir【目錄管理】

列出c盤下名為test的目錄

wmic fsdir where "drive='c:' and filename='test'" list

刪除c:\good資料夾

wmic fsdir "c:\\test" call delete

重新命名c:\test資料夾為abc

wmic fsdir "c:\\test" rename "c:\abc"

wmic fsdir where (name='c:\\test') rename "c:\abc"

複製資料夾

wmic fsdir where name='d:\\test' call copy "c:\\test"

7.datafile【檔案管理】

重新命名wmic datafile "c:\\test.txt" call rename c:\abc.txt

8.【任務計畫】:

wmic job call create "notepad.exe",0,0,true,false,********154800.000000+480

wmic job call create "explorer.exe",0,0,1,0,********154600.000000+480

比CMD更強大的命令列WMIC

先決條件 a.啟動windows management instrumentation服務,開放tcp135埠。b.本地安全策略的 網路訪問 本地帳戶的共享和安全模式 應設為 經典 本地使用者以自己的身份驗證 1.wmic node 192.168.1.20 user domain administ...

git 命令列 和 cmd命令列

設定全域性使用者名稱 git config global user.name 區域性把global換成local 檢視全域性 git config global list 檢視git的狀態 git status 初始化 git into 名字 新增乙個檔案 git add readme.txt 刪除...

強大的UNIX命令列

我們傳統的寫程式辦法是造單一而功能全面的程式,設法在乙個程式裡提供能夠全面滿足需求的功能,這樣的做法會造成程式龐大而複雜,可維護性降低。windows 上的程式通常如此,具有全面的功能,基本上不考慮與其他程式的配合,比方說有兩個程式都需要分頁,他們會各自開發乙個分頁模組,而不是去尋求共用分頁功能。在...