We need to run WMIC on about 1,500 machines (none of which have SCCM). We need to gather a lot of information, example:

cmd.exe /c wmic /append:"\\Server01\Logs$\inventory\Master.txt" computersystem get name, manufacturer /FORMAT:CSV
cmd.exe /c wmic /append:"\\Server01\Logs$\inventory\Master.txt" csproduct get name /FORMAT:CSV
cmd.exe /c wmic /append:"\\Server01\Logs$\inventory\Master.txt" diskdrive get size /FORMAT:CSV
cmd.exe /c wmic /append:"\\Server01\Logs$\inventory\Master.txt" wmic cpu get name,Manufacturer /FORMAT:CSV
cmd.exe /c wmic /append:"\\Server01\Logs$\inventory\Master.txt" memphysical get MaxCapacity /FORMAT:CSV
cmd.exe /c wmic /append:"\\Server01\Logs$\inventory\Master.txt" wmic OS get name,version /FORMAT:CSV

All of this works but the formatting in master.txt is total garbage. I've tried writing to a .htm file and it's no better.

Is there anyway to get wmic to format things in a better way? When I open up the .TXT file in Excel I want to be able to have stuff formatted in columns so we can sort but it's a big pile of junk at this point.
0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


According to your command lines the output should be in CSV format. Are you sure that you cannot use excel's text-to-column functionality to filter out your data?

One thing I notice is that you seem to be putting data in a single textfile with different column-formatting in the different lines. You might want to make sure you combine data that has different column structure in separate files...

Answered 06/21/2011 by: pjgeutjens
Red Belt

Please log in to comment
Check out MouseTrax's Domain Reporting Tool (no affiliation). I have run this - in customised form - for almost all of my clients at some point or other. Being in script - and in neatly modularised form - it's relatively simple to customise according to your client's requirements.
Answered 06/22/2011 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity