说明
1.输入资产编号
2.输入品牌型号
3.输入使用部门
4.输入使用人
5.输入备注
输出位置:脚本所在分区根目录下 PCInfo 中。
脚本代码
@echo off
set fgf=--------------------
md %~d0\PCInfo\
set /p zcbh=Input ZCBH:
set /p ppxh=Input PPXH:
set file=%~d0\PCInfo\%zcbh%.txt
set tempFile=%~d0\PCInfo\temp.txt
set /p userDept=Input userDept:
set /p userName=Input userName:
set /p bz=Input BeiZhu:
echo ZCBH=%zcbh% >> %file%
echo ppxh=%ppxh% >> %file%
echo userDept=%userDept% >> %file%
echo userName=%userName% >> %file%
echo BeiZhu=%bz% >> %file%
echo %fgf% >> %file%
REM 获取CPU 型号 ID
wmic cpu get name,processorid /format:list | more >> %file%
echo %fgf% >> %file%
REM 获取显卡 型号
wmic path win32_VideoController get name /format:list | more >> %file%
echo %fgf% >> %file%
REM 获取主板 型号 序列号
wmic baseboard get product,serialnumber /format:list | more >> %file%
echo %fgf% >> %file%
REM 获取内存 品牌 序列号 大小 频率
wmic memorychip get manufacturer,serialnumber,capacity,speed /format:list | more >> %file%
echo %fgf% >> %file%
REM 获取电脑 型号
wmic csproduct get vendor,name /format:list | more >> %file%
echo %fgf% >> %file%
pause
findstr /v "^$" %file% > %tempFile% & del %file% & ren %tempFile% %zcbh%.txt