@echo off
whoami > "%~dp0%computername%_%username%.txt"
WMIC /APPEND:"%~dp0%computername%_%username%.txt" BIOS Get Manufacturer,Name /Format:table
WMIC /APPEND:"%~dp0%computername%_%username%.txt" Baseboard Get Product,Manufacturer /Format:table
WMIC /APPEND:"%~dp0%computername%_%username%.txt" CPU Get Name,NumberOfCores,NumberOfLogicalProcessors /Format:table
WMIC /APPEND:"%~dp0%computername%_%username%.txt" Memorychip Get Manufacturer,Capacity,Speed,PartNumber /Format:table
WMIC /APPEND:"%~dp0%computername%_%username%.txt" Diskdrive Get Model,Size /Format:table
WMIC /APPEND:"%~dp0%computername%_%username%.txt" Path Win32_VideoController get Caption,VideoModeDescription /Format:table
WMIC /APPEND:"%~dp0%computername%_%username%.txt" OS get Caption,OSArchitecture,Version /Format:table
WMIC /APPEND:"%~dp0%computername%_%username%.txt" netuse get Name /Format:table
pause除了操作系统的字符串:只有“标题OSArchitecture版本”可以看到,但在CMD中,我可以看到脚本显示的所有内容都很好。
Caption OSArchitecture Version
Microsoft Windows 10 Pro 64-bit 10.0.17134如何使脚本不擦除此字符串?
发布于 2018-10-26 13:03:48
有时候,WMIC的Unicode输出本身有点太聪明了。通过FIND运行它将把它转换成本地代码页。
@echo off
SET "OUTFILE=%~dp0%computername%_%username%.txt"
IF EXIST "%OUTFILE%" (DEL "%OUTFILE%")
(
whoami
WMIC BIOS Get Manufacturer,Name /Format:table
WMIC Baseboard Get Product,Manufacturer /Format:table
WMIC CPU Get Name,NumberOfCores,NumberOfLogicalProcessors /Format:table
WMIC Memorychip Get Manufacturer,Capacity,Speed,PartNumber /Format:table
WMIC Diskdrive Get Model,Size /Format:table
WMIC Path Win32_VideoController get Caption,VideoModeDescription /Format:table
WMIC OS get Caption,OSArchitecture,Version /Format:table
WMIC netuse get Name /Format:table
) | FIND /V "" >>"%OUTFILE%"https://stackoverflow.com/questions/53007255
复制相似问题