本帖最后由 mxxcgzxxx 于 2011-5-28 21:26 编辑
收集了一些获取计算机数据的方法,有些是论坛里找的,有些是自己编的。
只在自己机上测试成功,有可能有错,请各位前辈多多指教。
如果有更多的可以接上本贴以供大家参考- @echo off
- setlocal enabledelayedexpansion
- set a=1
- for /f "skip=1 tokens=1,2,3" %%1 in ('wmic logicaldisk where DriveType^=3 get DeviceID^,freespace^,size') do (
- set n=%%2
- set /a g=!n:~-0,-3!/1024/1024!
- set n=%%3
- set /a t=!n:~-0,-3!/1024/1024!
- set "硬盘分区=!硬盘分区!%%1 !t!G余!g!G; "
- )
- for /f "skip=1 delims=" %%i in ('wmic BaseBoard get Product') do set 主板型号=%%i
- for /f "skip=1 delims=" %%i in ('wmic cpu get name') do set CPU型号=%%i
- for /f "skip=1 delims=" %%i in ('wmic cpu get socketdesignation') do set CPU插口=%%i
- for /f "tokens=1,2 delims==" %%a in ('wmic path Win32_VideoController get AdapterRAM^,Name /value^|findstr "AdapterRAM Name"') do set 显卡型号=%%b
- set d=1
- for /f "tokens=15" %%i in ('ipconfig ^| find /i "ip address"') do (
- set ip!d!=%%i
- set /a d+=1
- )
- for /f "tokens=1,2 delims= " %%1 in ('net config workstation ^| find "工作站域" ^| find /V "DNS"') do set 工作组=%%2
- for /f "tokens=3 delims=.: " %%i in ('ipconfig/all^|find "Physical"')do set mac=%%i
- set d=1
- for /f "skip=1 tokens=1* delims= " %%i in ('wmic nicconfig get caption') do (
- set 网卡型号!d!=%%j
- set /a d+=1
- )
- set d=1
- for /f "skip=1 tokens=1 delims= " %%i in ('wmic nicconfig get macaddress') do (
- set 网卡mac!d!=%%i
- set /a d+=1
- )
-
- echo 系统时间: %date%%time%
- echo 主板型号: %主板型号%
- echo CPU 型号: %CPU型号%
- echo CPU 类型: %CPU插口%
- echo 显卡型号: %显卡型号%
- echo 网卡型号: %网卡型号1%
- echo 网卡 MAC: %网卡mac1%
- echo 本地 IP : %ip1%
- echo 宽带 IP : %ip2%
- echo 工 作 组: %工作组%
- echo 计算机名: %userdomain%
- echo 当前用户: %username%
- echo 硬盘分区:
- echo %硬盘分区%
- echo 系统目录: %systemroot%
- echo 用户目录: %userprofile%
-
- pause>nul
复制代码
|