Scripting Blog [archived]

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

How Can I Create an Environment Variable Using a Script?

(image) Hey, Scripting Guy! Can I create an environment variable using a script?-- OD(image) (image) (image) Hey, OD. WMI is a great technology for scripting, but it has its eccentricities. For example, can you create a process using a script? Of course you can; after all, WMI’s Win32_Process class has a Create method. Can you create a ...

How Can I Determine Which Version of Internet Explorer is Installed on a Computer?

(image) Hey, Scripting Guy! How can I determine which version of Internet Explorer is installed on a computer?-- MG(image) (image) (image) Hey, MG. Probably the best (and definitely the easiest) way to do this is to use WMI; after all, using WMI makes it as easy to get this information from remote computers as it is to get it from the ...

How Can I Determine the System Time on a Computer?

(image) Hey, Scripting Guy! Is there any way to retrieve the system time as configured on a remote computer?-- JJ(image) (image) (image) Hey, JJ. There are at least two ways to do this, both using WMI. If you’re running Windows XP or Windows Server 2003, you can use the WMI class Win32_LocalTime. As you can see, that makes it pretty easy...

How Can I Determine the Next Available Drive Letter on a Computer?

(image) Hey, Scripting Guy! How can I determine the next available drive letter on a computer?-- TW(image) (image) (image) Hey, TW. Interesting question, and one that crops up from time-to-time. In the old days, when users only had drives A, B, and C, this was easy; you could pretty much guess that any drive letter other than those three ...

How Can I Run a Script Against a Range of IP Addresses?

(image) Hey, Scripting Guy! I’d like to run a script against all the computers on a subnet. Is there a way to do that without having to hardcode all the IP addresses into the script?-- RB(image) (image) (image) Hey, RB. Based on your email, it sounds like you have a setup similar to this: you have a subnet with IP addresses ranging from ...