When I run the command
wmic memorychip get capacity
from the command line in the cmd window, the output on the screen looks like:
Capacity
2147483648
However, if I add this command to a batch file and try to redirect the output to a file, like:
wmic memorychip get capacity >> %LOG%
(where %LOG% is just my log file where I want to append the data), it gets saved in the log file as:
C a p a c i t y
2 1 4 7 4 8 3 6 4 8
Here spaces got inserted before each character. In the Notepad++ it shows NULs inserted, for some reason I am not able to paste it here :(
Does anybody know why the output is changed such a way and how to avoid this transformation?