WMIC OS to htmlTable not working

Im trying to export some WMIC to html tables, and Ive managed to get some of the commands to work, such as:-
wmic /output:test.html computersystem list full /format:htable

Open in new window

But when I try is with other objects, such as OS:-
wmic /output:test.html os list full /format:htable

Open in new window

I get the message:-

Description = Invalid query

Any ideas how I can use the OS record and get it into a html table?

Thank you in advance
Who is Participating?
Mark WillsTopic AdvisorCommented:

the alias "OS" needs to use the get verb, not the list verb to retrieve the objects for that alias.

it is confusing, because you can do:
wmic OS list full /format /?

Open in new window

and it does show that htable is an option, but alas, not for the list verb.

the more formal way (instead of * ) is:
wmic /output:test.html os get /all /format:htable

Open in new window

So, it is possible, just need to check the options before hand - they can be quite different for each alias

You can always get a list of properties - with the available switches using the GET verb :
wmic OS get/?

Open in new window

And there you will find (finally) that the /FORMAT switch is available to use....

Hope that helps.
slightwv (䄆 Netminder) Commented:
Mark WillsTopic AdvisorCommented:
try : wmic /output:test.html os get * /format:htable
Mark WillsTopic AdvisorCommented:
Hello ?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.