Scripting Blog [archived]

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

How Can I Determine if My Users Have Certain Files on Their Computers?

(image) Hey, Scripting Guy! Is it possible to search a computer for .MP3 files or other files my users aren’t supposed to have?-- AK(image) (image) (image) Hey, AK. Once again it’s WMI to the rescue. Using the CIM_DataFile class it’s easy to search a computer for specific file types. Want to know if your users have any .MP3 files ...

Why Doesn't My LIKE Query Work on Windows 2000?

(image) Hey, Scripting Guy! I’m trying to use a LIKE query in my WMI scripts. The query works fine on Windows XP computers, but I can’t get it work on Windows 2000 computers. Do you know what I’m doing wrong?-- GS(image) (image) (image) Hey, GS. Actually you’re not doing anything wrong. You’re using a script similar to this, which ...

How Can I Tell Which Account a Service is Running Under?

(image) We have services that run under a particular user account. Each time we change the password for that user account, we need to change the password for any services that run under that account as well. But how can we tell which account a service is running under?-- SA(image) (image) (image) Hey, SA. By and large WMI is a pretty ...

Why am I Getting an Error when Trying to Determine an IP Address?

(image) Hey, Scripting Guy! I’m trying to determine the IP address on a computer, but I keep getting a Type Mismatch error. Do you know why? -- AQ, Jacksonville, FL(image) (image) (image) Hey, AQ. As a matter of fact, we do know why you’re getting a Type Mismatch error, and it’s a common problem when working with the WMI class ...

Registry Script Doesn't Work

(image) Hey, Scripting Guy! I tried writing a script to read data from the registry, but I keep getting this error: (image)   Do you have any idea what's wrong? I'm running Windows XP Professional, Service Pack 1, and this is the code I'm using: -- LW, Omaha, NE(image) (image) (image) Hey, LW. The error you are getting (80041010) means...