Script Tips

Talking Scripts

Give your scripts the power of speech.

The SAPI (Speech Application Programming Interface) object is a scriptable one, which means you can take advantage of this feature in your scripts. It's built into Windows XP and later systems (including Server 2003) so if your target systems are new enough, you're already set up to make use of it.

Set objVoice = CreateObject("SAPI.SpVoice")
objVoice.Speak "Welcome to the machine"

That is all there is to it. Create a reference to the object and use the "speak" method to instruct the specified text to be spoken. Almost disappointingly, the voice "Microsoft Anna" that ships with Vista sounds very good, and you can't have fun with the expected "computer voice" sound with which you may be familiar.

Windows XP included "Microsoft Sam" and a couple of more voices are available by installing the SAPI SDK (click here to download).

Tech Help—Just An
E-Mail Away

Got a Windows, Exchange or virtualization question or need troubleshooting help? Or maybe you want a better explanation than provided in the manuals? Describe your dilemma in an e-mail to the editors at [email protected]; the best questions get answered in this column and garner the questioner with a nifty Redmond T-shirt.

When you send your questions, please include your full first and last name, location, certifications (if any) with your message. (If you prefer to remain anonymous, specify this in your message, but submit the requested information for verification purposes.)

So when would you use such a thing? Well, like lots of nice things you can do, maybe there is no good excuse to take advantage of it. It's like the good old "Beep" sound from the early days: As soon as administrators discovered you could make the computer beep by simply typing "beep" logon scripts, users the world over started complaining. Well, here we go again -- have fun with this one before the complaints start rolling in.

About the Author

Bob Kelly is president and co-founder of, home to an integrated suite of scripting tools and a shared library of scripts and language help. He has authored books on scripting and desktop administration and several white papers. Bob also owns and operates, where he writes and produces videos on topics related to software deployment.

comments powered by Disqus
Most   Popular