Board logo

标题: [文本处理] 批处理命令wmic输出到文本字体异常求助! [打印本页]

作者: taosicai    时间: 2015-6-25 10:45     标题: 批处理命令wmic输出到文本字体异常求助!

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




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2