最近一些DOS命令學習

來源:互聯網
上載者:User
雖然在平時的開發中沒有怎麼用到,但有時候做C++,C#等等的開發中,尤其是做底層開發的時候,
一些PowerShell命令相當的方便,在編譯時間候幾行命令就中已解決了,呵呵!!

下面是一些擷取通過命令擷取硬體設定資訊,

1. 在DOS下直接輸入命令,即可擷取:


::擷取磁碟資料: wmic DISKDRIVE get deviceid,Caption,size,InterfaceType
::擷取分區資料: 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


2. 當然你也可以通過一個批次檔,雙擊一下就出來了,下面是指令碼:
@echo off&setlocal ENABLEDELAYEDEXPANSION 
set sig=0 for /f %%i in ('wmic DISKDRIVE get signature')
do ( set /a sig+=1 if !sig!==2 set pcid=%%i )
set sig=0 for /f %%i in ('wmic cpu get ProcessorId')
do ( set /a sig+=1 if !sig!==2 set pcid=!pcid!%%i )
echo cpu的id和硬碟序號的組合為: %pcid% pause



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.