WMIC Format Question
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.
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
Answers (2)
Please log in to answer
Posted by:
pjgeutjens
13 years ago
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...
PJ
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...
PJ
Posted by:
anonymous_9363
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.