2015-11-06 55 views

回答

0

我建議你將輸出重定向到一個文本文件,然後再處理它存儲到一個變量:

myscript.bat:

Setlocal EnableDelayedExpansion 
wmic cpu get name,numberofcores,numberoflogicalprocessors > out.txt 
set txt= 
for /f "tokens=*" %%i in (out.txt) do set txt=!txt!%%i 
echo !txt! 
Endlocal