- @echo off
- setlocal EnableDelayedExpansion
-
- (
- @echo === Inf:OS ===
- wmic OS Get Name, ServicePackMajorVersion
- @echo =================================&@echo.
-
- @echo === Inf:CU ===
- for /f "tokens=2 delims==" %%a in ('wmic Path Win32_PerfFormattedData_PerfOS_Processor Get PercentProcessorTime /value ^| findstr "PercentProcessorTime"') do (set UseCPU=%%a)
- @echo CPU使用率:!UseCPU!%%
- @echo =================================&@echo.
-
- @echo === Inf:MU ===
- wmic OS Get TotalVirtualMemorySize, FreeVirtualMemory, SizeStoredInPagingFiles, TotalVisibleMemorySize, FreePhysicalMemory
- @echo =================================&@echo.
-
- @echo === Inf:DU ===
- wmic LogicalDisk Where DriveType=3 Get Caption, VolumeName, Size, FreeSpace
- @echo =================================&@echo.
-
- ) > a.txt
-
- (
- @echo === Inf:RT ===
- @echo 结束时间 : 20%DATE:~2,2%.%DATE:~5,2%.%DATE:~8,2% %hour: =0%:%TIME:~3,5%
- @echo =================================
- ) >> a.txt
复制代码 各位高手,wmic输出直接输出到屏幕,效果正常。
但输出至文本文件,每个字母和数字,都增加了一个空格!!!
为什么?怎样能得到正常字体的输出? |