after batch file output to txt, the font not consistent?


  1. Posts : 25
    Windows 7 Ultimate x64
       #1

    after batch file output to txt, the font not consistent?


    I wrote a batch file to output my system infor to a txt file.
    After I run it, I found that the fonts are not the same.
    The output for "wmic" obviously are different than others (See attachment).
    There is also a big gap for CPU infor. I tried to delete the "echo." but no luck.
    However, while I run "wmic" alone, its output is normal. but while I put some commands before "wmic", the fonts look wired.
    anyone know why? thanks!


    Here is my code:


    @echo off
    echo Checking your system infor, Please wating...
    systeminfo | findstr /c:"Host Name"
    systeminfo | findstr /c:"Domain"
    systeminfo | findstr /c:"OS Name"
    systeminfo | findstr /c:"OS Version"
    systeminfo | findstr /c:"System Manufacturer"
    systeminfo | findstr /c:"System Model"
    systeminfo | findstr /c:"System type"
    systeminfo | findstr /c:"Total Physical Memory"

    ipconfig | findstr /c:"IP Address"

    echo.

    echo Hard Drive Space:
    wmic diskdrive get size

    echo.
    echo.

    echo Service Tag:
    wmic bios get serialnumber

    echo.
    echo.
    echo CPU:
    wmic cpu get name

    echo Completed! Thank you!

    pause
    Attached Thumbnails Attached Thumbnails after batch file output to txt,  the font not consistent?-tag.png  
      My Computer


  2. Posts : 966
    Windows 7 Ultimate 64-bit
       #2

    Yeah, so I tried it myself and I didn't have any issues.



    If you want your system Information, download an awesome little app called Speccy from Piriform (Piriform - Download CCleaner, Defraggler, Recuva, Speccy - Millions of users worldwide!). It pulls from the hardware itself, not just what Windows thinks it is.
      My Computer


  3. Posts : 110
    Windows 7 Professional x64
       #3

    In the attached batch script, I fixed your spacing problem, and I fixed the IP Address detection. Run it by typing info.bat > info.txt in Command Prompt. Please rep me if it works (the small scale in the upper right corner of this post), or tell me if it doesn't.
    after batch file output to txt,  the font not consistent? Attached Files
    Last edited by BriceH; 30 Dec 2010 at 20:52. Reason: Accidently wrote square instead of scale.
      My Computer


  4. Posts : 25
    Windows 7 Ultimate x64
    Thread Starter
       #4

    BriceH said:
    In the attached batch script, I fixed your spacing problem, and I fixed the IP Address detection. Run it by typing info.bat > info.txt in Command Prompt. Please rep me if it works (the small scale in the upper right corner of this post), or tell me if it doesn't.
    Thank you for your help. so the "fixit.tmp" is for storing the info temporally?
    It does work! but not work for all my cases.
    I tested it on about 20 PCs, it worked perfectly on XP.
    however, for vista and win7, no output show up for those commands with "fixit.tmp" in some computers.(see attachment)
    I also tried different computer in the same model. only two win7 computers showed up all info, and other six missed some output.( like the pictures).
    I don't know why this happen, but I use my original bat file for those six computers, the missed info showed up, but the fonts are off.
    ANY CLUE?


    My updated Code:


    @echo off
    systeminfo | findstr /c:"Host Name"
    systeminfo | findstr /c:"Domain"
    systeminfo | findstr /c:"OS Name"
    systeminfo | findstr /c:"OS Version"
    systeminfo | findstr /c:"System Manufacturer"
    systeminfo | findstr /c:"System Model"
    systeminfo | findstr /c:"System type"
    systeminfo | findstr /c:"Total Physical Memory"

    echo.
    echo Hard Drive Space:
    wmic diskdrive get size > fixit.tmp
    type fixit.tmp

    echo.
    echo Service Tag:
    wmic bios get serialnumber > fixit.tmp
    type fixit.tmp

    echo.
    echo Released Date:
    wmic bios get releasedate > fixit.tmp
    type fixit.tmp

    echo.
    echo CPU:
    wmic cpu get name > fixit.tmp
    type fixit.tmp

    del fixit.tmp

    echo.
    ipconfig | findstr /c:"IPv4 Address"

    echo.
    echo Completed!
    Attached Thumbnails Attached Thumbnails after batch file output to txt,  the font not consistent?-ex1.jpg   after batch file output to txt,  the font not consistent?-ex2.jpg  
    Last edited by beidog; 31 Dec 2010 at 01:45. Reason: add images!
      My Computer


  5. Posts : 110
    Windows 7 Professional x64
       #5

    On the machines that don't work, please try following the following steps and tell me if they work.
    1. Open Command Prompt
    2. cd Desktop
    3. echo This is a test > test.txt
    4. Open test.txt on your desktop and see if it says "This is a test".
    5. Back in cmd, try type test.txt and see if it correctly displays the content of test.txt.
    Last edited by BriceH; 31 Dec 2010 at 10:11. Reason: Fixing Numbered List
      My Computer


  6. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #6

    Here is my version of the code, and the output it produces:

    Code:
    @echo off
    echo Checking your system information. Please wait...
    echo.
    systeminfo | findstr /c:"Host Name"
    systeminfo | findstr /c:"Domain" 
    systeminfo | findstr /c:"OS Name" 
    systeminfo | findstr /c:"OS Version" 
    systeminfo | findstr /c:"System Manufacturer" 
    systeminfo | findstr /c:"System Model"
    systeminfo | findstr /c:"System type" 
    systeminfo | findstr /c:"Total Physical Memory"
    echo. 
    ipconfig | findstr /c:"IPv4 Address" 
    ipconfig | findstr /c:"IPv6 Address"
    echo.
    echo Hard Drive Space: 
    wmic diskdrive list brief 
    echo BIOS: 
    wmic bios list brief 
    echo CPU: 
    wmic cpu list brief
    echo Completed! Thank you!
    pause
    after batch file output to txt,  the font not consistent?-capture.png
      My Computer


  7. Posts : 25
    Windows 7 Ultimate x64
    Thread Starter
       #7

    BriceH,
    Thanks, I figured it out. I need to output "wmic" commands to a actual file in the hard disk(such as C:\temp.txt) and then "type" it and "del" it. but i am still wondering why some PCs wouldn't work just like the others.
    I appreciated your help.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:21.
Find Us