I am trying to output the name and version of each program installed on my system to a .csv file. I could do something more complicated with VBScript, but would prefer to keep this very simple to include as a batch file that will run just before performing a system backup. After some research, I came up with the below:
wmic product get name,version /format:csv |more >Installed_Apps.csv
When I open the resulting file in Notepad, I see that it adds blank row at the top of the file and a node column. While neither are desired, I can live with both of these oddities. The thing that is bothering me, however, is that if I 2x click the file and open in Excel, there is a blank row between each row of results that I don't see when I open the file in Notepad.
Examples:
Notepad:
ComputerName,Software1,1.0
ComputerName,Software2,2.1
ComputerName,Software3,2.5
Excel:
ComputerName,Software1,1.0
ComputerName,Software2,2.1
ComputerName,Software3,2.5
I assume this is because the WMIC output was originally in Unicode, but I thought I was working around that correctly by adding |more
to the command. From what I can tell, the file is in ASCII format, but I didn't inspect all the characters.
Any thoughts on what might be causing this and how to resolve this such that the file does not have the extra blank rows when opening in Excel?
Thanks!