Log in

No account? Create an account

Previous Entry | Next Entry

I have written my first VB Script code that pulls in some WMI resources.

If you have no idea what I'm talking about, nod your head and smile. Then step back. Very slowly.

First, I got a book that is helping me out wildly -- Microsoft Windows 2000 Scripting Guide. This was designed equally for people who know nothing of scripting (moi) to those that are well versed. It also doesn't cover the crud like finding the secant of an angle or embed code into a web page-- it covers how to use the power of scripting to administer an environment. Pretty cool stuph man!

We had a need to have a script that would stop a service, modify two entries in the registry based on a random integer from 1 to 4 (inclusive), then start the service in the registry. Oh, and the script should be able to give messages to the person running this with no stopping of the script. That means that it needs to run as a CScript only, even when double clicked in Explorer. Needless to say, not knowing much scripting, I "borrowed" from many sources. But, 82 lines of commented, well spaced code later, I have a script that works.

And now, I have several sites to reference, sample code, and a better understanding of what the heck it is that I'm doing!