Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


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

29 Dec 2010   #1
beidog

Windows 7 Ultimate x64
 
 
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
after batch file output to txt,  the font not consistent?-tag.png  
My System SpecsSystem Spec
.
30 Dec 2010   #2
Johnathan Lyman

Windows 7 Ultimate 64-bit
 
 

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 System SpecsSystem Spec
30 Dec 2010   #3
BriceH

Windows 7 Professional x64
 
 

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.


Attached Files
File Type: bat info.bat (647 Bytes, 165 views)
My System SpecsSystem Spec
.

31 Dec 2010   #4
beidog

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by BriceH View Post
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 Images
after batch file output to txt,  the font not consistent?-ex1.jpg after batch file output to txt,  the font not consistent?-ex2.jpg 
My System SpecsSystem Spec
31 Dec 2010   #5
BriceH

Windows 7 Professional x64
 
 

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.
My System SpecsSystem Spec
31 Dec 2010   #6
Dwarf

Windows 8.1 Pro RTM x64
 
 

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 System SpecsSystem Spec
31 Dec 2010   #7
beidog

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
Reply

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




Thread Tools




Similar help and support threads
Thread Forum
How to run a batch file at logoff & some batch scripting help please
Hiya, I'd just like to run a simple batch file at logoff to backup some settings. I plan to use Robocopy, which is what i use to more thorough backups. Two questions: 1. How make it run by clicking Start > Shutdown? (i realise i could make a shutdown batch file and run it instead, but i'd...
Backup and Restore
File Views Are Not Consistent
Hello, I find myself in an interesting situation where a user of mine is insisting everything they open up be in the list view. In the past I have corrected this by going to folder options and after configuring the desired view and applied folder settings to all folders. Certain open or save...
Customization
Custom batch file that copies font files to another folder?
I just downloaded all of the Google Web Fonts and they were each downloaded into their respected folders, so instead of clicking on folder after folder and right clicking after right clicking and finally installing each and every font; How can I create a command prompt (batch) file so the prompt...
General Discussion
Batch File that grabs file names from folder to insert into batch file
Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can... :confused: First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg. Here's the code that I'm using: ffmpeg -i...
General Discussion
batch file open file for program in the startup folder
I have a computer that is a drone specifically for an outside LED sign. This computer is designed to never shut off and doesn't have any other program on it besides Operating System and the sign software. I need to create a batch file that I can place in the "start-up" folder that will open the...
General Discussion
How to create a batch file that will move files based on the file type
How to create a batch file that will move files based on the file type? My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...
General Discussion


Our Sites

Site Links

About Us

Find 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 11:29.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App