In creating an auditing tool for my network, I'm finding that WMIC is outputting with spaces in between each character when accompanied by echoing regular text. For example,
This:
@echo off
echo Foo >> "C:\test.txt"
wmic CPU Get AddressWidth >> "C:\test.txt"
wmic CPU Get Description >> "C:\test.txt"
Returns this:
Foo
A d d r e s s W i d t h
6 4
D e s c r i p t i o n
I n t e l 6 4 F a m i l y 6 M o d e l 6 9 S t e p p i n g 1
If I remove (rem
) the echo Foo
line, the output is formatted nicely since there is only one output type:
AddressWidth
64
Description
Intel64 Family 6 Model 69 Stepping 1
I'm reading that this is because WMIC outputs to UNICODE, while standard batch commands output to ANSI. Can both be joined to share a common format? Can someone please explain in more depth the different format types, why WMIC would output to a different type, and/or any other contributing factors to this output? I've found some bread crumbs, but nothing concrete.