VBscript (don't puke, you'll like this one)

by Jesse 26. March 2008 07:01

"Back in the day" I use to do net admin work -- had a nice little network running that had taken a few years to get up to date.  One of the things I discovered was the magics of WMI and vbscripts.  During this time, I began writing scripts that did ...pretty much everything.  From mapping drives to doing inventory to diagnostics, I had about 50 scripts that did almost everything I needed to do on a day to day basis.

One super cool feature was using microsoft's speech, which has been available in WMI for a while now (I remember it working on win2k).  This allowed an audio warning of sorts to be conveyed to the user if necessary.  Realizing the possible terroristic evilness just to screw with someone interesting nature of this, I wrote a script for a friend of mine that has a teenage daughter that was having problems keeping her on task ...I was happy to help fixing this problem.  Before we get into that, lets take a quick look at getting to things in WMI.

No surprise,  I used google for most of my scripting adventures.  "<some kind of process> vbscript" yielded most pages that I could piece together what I needed.  Consider that the quick and dirty way.  So what's WMI anyway?  Windows Management Instrumentation -- in english, if you can do it with a mouse/keyboard in the OS, you can do it WMI ...and more.  Using WMI is stupid easy.  No complier, no drama (built in!)  Got notepad?  Good, that's all you need.  Open up notepad, copy/paste this, rename it with a .vbs extention, double click and check out your message box.  You need admin-ish rights for this to work (and you CAN enter "localhost" in the textbox)

Ok, big deal right?  Create another file, name it "voice.vbs" and paste this into it.

set objVoice = CreateObject("SAPI.SpVoice")
objVoice.Volume = 100
objVoice.Speak "This is the coolest blog ever!"

Save it and run it.  Have fun with that and yes it does a nice job pronouncing things.  And if you can figure it out, IF you have admin rights to a box on the network ...figure out how to make this work with the voice.  It can be done, but I'm not telling you how -- because its possible uses are just outright evil ...and a great source of entertainment!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Coding

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Like the description says, at my core, I'm a scientist and engineer.  I came from humble beginnings on a 486DX2 Packard Hell playing doom2 on IPX to in a small time retail shop and got into hardware (ISO layers FTW!) and it was all downhill from there.  I'm infinitely curious about almost everything and always wanting to know.

Some of the stuff I'm currently into/researching...

Sitefinity

Ninject

Subsonic

Java

Currently working on ...
i did the hundred 
and some extra stuff

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's, their brother nor their dog's view in anyway.  At all.  Ever.

© Copyright 2007-2008