Scripting Blog [archived]

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

How Can I Change a Read-only File to a Read-write File?

(image) Hey, Scripting Guy! How can I change a read-only file to a read-write file?-- WR(image) (image) (image) Hey, WR. We don’t mean to shock you, but how can you change a read-only file to a read-write file? Why, by using a script, of course! We know: you never saw that coming, did you? As a matter of fact, you can use this script, ...

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 ...

How Can I Determine the Percentage of Free Space on a Drive?

(image) Hey, Scripting Guy! I know how to determine the amount of free space on a drive, but how can I determine the percentage of free disk space on a drive?-- MS(image) (image) (image) Hey, JP. You’re right: determining the amount of free disk space on a drive is pretty easy. For example, this simple little script tells you the amount ...

How Can I Write to the Comments Field of a Document?

(image) Hey, Scripting Guy! Can I add text to the Comments field of a file using a script?-- EF(image) (image) (image) Hey, EF. For those of you who aren’t sure what EF is referring to, right-click a document in Windows Explorer and then click Properties. In the dialog box that appears, click on the Summary tab. See the text box labeled ...

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 ...