How to get started creating scripts with WMI Code Creator

In this post I will introduce you to a great little tool from Microsoft that can help you getting started creating WMI scripts in C#, Visual Basic or VB script. The tool is free and can help you creating small scripts that can collect data from WMI or execute commands on local or remote computers. Scripting against the WMI namespace you can do a lot of cool stuff like collect information about Operating system or Hardware information. It is also possible to execute commands like reboot or other admin tasks that you might find useful.

What is WMI?

WMI (Windows Management Instrumentation) is a set of extensions to the Windows Driver Model that provides an operating system interface through which instrumented components provide information and notification. With WMI you can find almost any information about your hardware and software on your system.

How to use WMI Code Creator

When you start up WMI Code Creator you can select what scripting language output you want WMI Code Creator to use under the Code Language menu.

WMI Code Creator

Select Namespace and Class

The next thing you want to do is to select the Namespace and the class you want to work with. There are so many classes and properties to choose from and with WMI you can find almost any information about your computer that you would like. In the example below I have chosen the Namespace: root\CIMV2 and the class Win32_OperatingSystem. As you can see it contains 63 properties about the Operating System. I have chosen the property Caption that contains the name of my Operating System.

WMI Code Creator 2

While I select my properties I want to query the code window on the right automatically update the code based on the options I choose. When you are done you can choose to execute the code from inside the program or open the code in notepad to make your own changes to the script or to copy it to your favorite Script editor.

WMI Code Creator 3

WMI Code Creator 4

That was all I wanted to teach you today. I hope you found this post useful and want to check out this tool on your own. I will love if you drop me a comment below and maybe share this post with your friends.

Download WMI Code Creator

 

Related posts

14 Thoughts to “How to get started creating scripts with WMI Code Creator”

  1. Thanks Thomas for sharing us this informative article!! I am looking forward to use WMI and hope it will work great for me.

  2. Rashmi Sinha

    I am not a coder chick but I think trying different things is a way of life. Will give it a shot at it since now I know little bit about the know-how of this WMI.
    Thanks for the share Thomas.

    1. Hi Rashmi
      This tool is a great way to get started creating small useful scripts. You should give it a try for sure.

      1. Yeah…

        I will try it on this coming weekend for sure. Hope it will carve a new learning curve for me.

  3. Hi Thomas,

    I have started coding after I joined blogging and love to experiment different options. Your tutorial was great and will use WMI code creator to try coding. Thanks. 🙂

  4. Mohanraj

    Hello,

    Thanks a lot for compilation and time and effort put on this article.

    As a new reader of your blog I am loving each and every moment spent on it over past 2 days.
    One of my favourite blogs now.

  5. Farrell John Conejos

    Hey Thomas,

    It’s good to read a blog post like this. Not everyone is good at coding. Others are even too afraid to try it. The information and explanation you posted is really helpful. It gives hope to those who are aspiring to learn. Thanks for the share!

  6. Nice post. I have never tried the coding thing, but after reading your post I might just give it a shot.

  7. Richard

    After reading the information and instructions you have provided here, I realized that WMI scripting is not that easy after all. I’ve learned that scripting allows me to complete various tasks. I also believed that this will be of great help for other who has confusion about WMI. Thanks for sharing this post then.

  8. Jacob

    Thanks for sharing …..Nice post…WMI Code Creator’s functionality isn’t unique. A previous tool from Microsoft called Scriptomatic used to do the same thing but, as far as I’m aware, hasn’t been updated since 2005 and didn’t work on Windows 7 the last time I tried it.

    1. Hi Jacob
      I think that I have heard about Scriptomatic, but I have never used it myself.

  9. This device is a great way to get began developing little useful programs. You should give it a shot for sure.

  10. I was looking through the old posts and I found this little gem. I run a technical support business and I can see how this could be very helpful. Im just imagining something I can make with this now. Thanks Thomas

Leave a Reply to Thomas Cancel reply