2
1
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!


Thanks for the response, Karan. I guess I should have said I was already aware of the two manual ways you mentioned to resolve the issue, but I want to avoid anything manual. I am also aware that I can convert the file from Unicode to Ansi by removing the
|moreand then running the below command:Thanks again – Fred – 2015-05-05T16:08:52.517
I used Notepad++. Can you tell me why a single line script is necessary? Wouldn't creating a batch file suffice? – Karan – 2015-05-05T23:57:18.207
Thanks. It's not necessary. I would just prefer to write the correct answer to file once rather than writing a file, converting it, and deleting the original. If there is a more efficient way to fix the original syntax, or a better method all together, such that it writes the desired output without the added rows or having to write/convert/delete, I'd like to learn the technique/syntax. – Fred – 2015-05-06T13:48:40.370
See the edit above. – Karan – 2015-05-06T18:43:48.577
the wmic line that specifies
/format:csv.xslis a typo - it should just be/format:csv. Otherwise the solution provided works great! – Jason – 2019-08-28T21:34:47.050