Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 獲得系統版本信息
- wmic datafile where Name='c://windows//explorer.exe' get Manufacturer,Version,Filename
- 獲得系統進程
- wmic process list full 注意:
- 這裏的full也可以換成brief(簡潔)
- 獲得硬件信息(這裏以cpu为例)
- wmic cpu get name,caption,maxclockspeed,description
- 將結果輸出到d盤的1.txt裏面
- wmic /output:D:/1.txt cpu get name
- wmic 獲取硬盤固定分區盤符:
- wmic logicaldisk where "drivetype=3" get name
- wmic 獲取硬盤各分區文件系統以及可用空間:
- wmic logicaldisk where "drivetype=3" get name,filesystem,freespace
- wmic 獲取進程名稱以及可執行路徑:
- wmic process get name,executablepath
- wmic 刪除指定進程(根據進程名稱):
- wmic process where name="qq.exe" call terminate
- 或者用
- wmic process where name="qq.exe" delete
- wmic 刪除指定進程(根據進程PID):
- wmic process where pid="123" delete
- wmic 創建新進程
- wmic process call create "C:/Program Files/Tencent/QQ/QQ.exe"
- 在遠程機器上創建新進程:
- wmic /node:192.168.1.10 /user:administrator /password:123456 process call create cmd.exe
- 關閉本地計算機
- wmic process call create shutdown.exe
- 重启遠程計算機
- wmic /node:192.168.1.10/user:administrator /password:123456 process call create "shutdown.exe -r -f -m"
- 更改計算機名稱
- wmic computersystem where "caption='%ComputerName%'" call rename newcomputername
- 更改帳戶名
- wmic USERACCOUNT where "name='%UserName%'" call rename newUserName
- wmic 結束可疑進程(根據進程的启動路徑)
- wmic process where "name='explorer.exe' and executablepath<>'%SystemDrive%//windows//explorer.exe'" delete
- wmic 獲取物理內存
- wmic memlogical get TotalPhysicalMemory|find /i /v "t"
- wmic 獲取文件的創建、訪問、修改時間
- @echo off
- 'wmic datafile where name^="c://windows//system32//notepad.exe" get CreationDate^,LastAccessed^,LastModified
- wmic 全盤搜索某文件並獲取該文件所在目錄
- wmic datafile where "FileName='qq' and extension='exe'" get drive,path
- for /f "skip=1 tokens=1*" %i in ('wmic datafile where "FileName='qq' and extension='exe'" get drive^,path') do (set "qPath=%i%j" & @echo %qPath:~0,-3%)
- 獲取屏幕分辨率
- wmic DESKTOPMONITOR where Status='ok' get ScreenHeight,ScreenWidth
- 獲取共享資源(包括隱藏共享)
- WMIC share list brief
- 獲取U盤盤符,並運行U盤上的QQ.exe
- @for /f "skip=1 tokens=*" %i in ('wmic logicaldisk where "drivetype=2" get name') do (if not "%i"=="" start d:/qq.exe)
- 獲得進程當前占用的內存和最大占用內存的大小:
- wmic process where caption='filename.exe' get WorkingSetSize,PeakWorkingSetSize
- 更改現有工作組为指定的工作組
- wmic computersystem Where "name='計算機名稱' call UnjoinDomainOrWorkgroup
- 退出所在域
- wmic computersystem Where "name='計算機名稱'" call joindomainorworkgroup "",1,"域名稱","域管理員密碼","域管理員用戶名"
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 開2003的3389
- wmic RDTOGGLE WHERE ServerName='%COMPUTERNAME%' call
- SetAllowTSConnections 1
- 遠程打開計算機遠程桌面
- wmic /node:%pcname% /USER:%pcaccount% PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSConnections 1
- 添加的計劃任務,wmic添加的同样AT命令也是可以看到
- wmic job call create "sol.exe",0,0,true,false,********154800.000000+480
- wmic job call create "sol.exe",0,0,1,0,********154600.000000+480
- 這兩句是相同的,TRUE可以用1表示,同样的FALSE可以用0值表示,時間前为何用八個星號,這是WMIC的特性,他顯示時間的方式是YYYYMMDDHHMMSS.MMMMMM+時區 ,可是,我們並不需要指定年份和月份還有天,所以用*星號來替代
- 在wmic下查看BIOS信息
- wmic bios list full
- wmic還有停止、暫停和運行服務的功能:
- 启動服務startservice,停止服務stopservice,暫停服務pauseservice。
- 具體的命令使用格式就是:
- wmic Service where caption=”windows time” call stopservice
- ●--停止服務
- wmic Service where caption=”windows time” call startservice
- ●--启動服務
- wmic Service where name=”w32time” call stopservice
- ●--停止服務,注意name和caption的區別。
- 遠程創建進程
- wmic /node:109.254.2.102 /user:"rdgad/administrator" /password:"1234" process call create commandline="cmd.exe /k echo xxxxx|clip.exe"
- 獲取硬盤序列號:
- wmic diskdrive get model
- Update static IP address
- wmic nicconfig where index=9 call enablestatic("192.168.16.4"), ("255.255.255.0")
- Change network gateway
- wmic nicconfig where index=9 call setgateways("192.168.16.4", "192.168.16.5"),(1,2)
- Enable DHCP
- wmic nicconfig where index=9 call enabledhcp
- Service Management
- wmic service where caption="DHCP Client" call changestartmode "Disabled"
- Start an application
- wmic process call create "calc.exe"
- Terminate an application
- wmic process where name="calc.exe" call terminate
- Change process priority
- wmic process where name="explorer.exe" call setpriority 64
- Get list of process identifiers
- wmic process where (Name='svchost.exe') get name,processid
- Information about harddrives
- wmic logicaldisk where drivetype=3 get name, freespace, systemname, filesystem, size, volumeserialnumber
- Information about os
- wmic os get bootdevice, buildnumber, caption, freespaceinpagingfiles, installdate, name, systemdrive, windowsdirectory /format:htable > c:osinfo.htm
- Information about files
- wmic path cim_datafile where "Path='\windows\system32\wbem\' and FileSize>1784088" > c:wbemfiles.txt
- Process list
- wmic process get /format:htable > c:process.htm
- ---
- wmic process where name="javaw.exe" list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement