How to format batch command result on text file

后端 未结 4 1149
清歌不尽
清歌不尽 2020-12-07 06:31

I am retrieving computer information using the batch script below,

(
    systeminfo | findstr /c:\"Host Name\" /c:\"Domain\" /c:\"OS Name\" /c:\"OS Version\"         


        
4条回答
  •  伪装坚强ぢ
    2020-12-07 06:56

    This should work for you.

    @echo off
    
    systeminfo | findstr /c:"Host Name" /c:"Domain" /c:"OS Name" /c:"OS Version" /c:"System Manufacturer" /c:"System Model" /c:"System type" /c:"Total Physical Memory" /c:"Available Physical Memory">"getPCinfo.txt"
    
    FOR /F "tokens=1,2 delims==" %%G IN ('wmic bios get serialnumber /value ^|find /I "serialnumber"') DO >>"getPCinfo.txt" echo %%G :   %%H
    

提交回复
热议问题