Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Hey, Scripting Guy! How Can I Evaluate a Condition and Select from Several Options with Windows PowerShell?

(image) Hey, Scripting Guy! I want to evaluate a condition and select from several different options. I know I could use the If…Then…ElseIf to do this, but it is somewhat cumbersome and yesterday you said there was a better way to do these kinds of things. What’s the better way?- KM(image) (image) Hi KM, You are not going to believe ...

Hey, Scripting Guy! How Can I Create an HTA to Do Temperature Conversions?

(image) Hey, Scripting Guy! I read with interest your "blog from down under," and I was interested in your function that converts Fahrenheit to Celsius. My wife and I are going on vacation to Germany, and I want to be able to do metric conversions. The problem, however, is that I do not want to install Windows PowerShell on my wife's laptop...

Hey, Scripting Guy! How Can I Troubleshoot Drive-Mapping Issues?

(image) Hey, Scripting Guy! We have this problem at work. Users seem to always be losing their mapped drives. It is a real mess, and we spend a couple hours every morning trying to help the users remap their drives. We have more than 160 logon scripts, and it seems that one logon script maps a drive, and then another remaps the drive ...

Hey, Scripting Guy! How Can I Compare Files With the Same Name But Two Different Extensions?

(image) Hey, Scripting Guy! After doing several restores we have folders with files named name.doc AND name.do (without "C"). How can we identify such pairs of files and do something to them based on a comparison?-- TN(image) (image) Hi TN, Scripts like the one we’ll develop in this article are the best tools I know of for dealing with ...

Hey, Scripting Guy! How Can I Read the MAC Address From a Text File?

(image) Hey, Scripting Guy! I've been asked to create a script which will read the contents of addresses.txt and output ONLY the MAC addresses listed in the text file. Could you give me some pointers or even a demo script with which to give me a boost?-- FR(image) (image) (image) Hi FR, The last time someone asked the person writing this ...