Scripting Blog [archived]

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

How Can I Monitor for Different Types of Events With Just One Script?

 (image) Hey, Scripting Guy! Is there any way to monitor a folder for file creations and deletions, all with just one script? -- HA(image) (image) (image) Hey, HA. By the way, thanks for the question: you temporarily saved us from answering a different question, one that was proving a bit difficult thanks to some surprising ...

How Can I Be Notified Any Time a Network Cable Gets Unplugged?

(image) Hey, Scripting Guy! Is there a way I can be notified any time a network cable gets unplugged on a computer?-- DD(image) (image) (image) Hey, DD. A lot of people, when growing up, had a grandmother or an aunt or someone somewhere who had a house with a big attic, an attic overflowing with stuff. Admittedly, most of the time you had ...

How Can I Automatically Run a Script Any Time a File is Added to a Folder?

(image) Hey, Scripting Guy! Is it possible to have a script automatically run any time a file is added to a specific folder?-- MB(image) (image) (image) Hey, WM. Yes, this is possible, thanks to the magic of WMI events, which allow you to write a script to monitor for something of interest (like a file being added to a folder) and then ...

How Can I Be Notified Any Time a Service Goes Down?

(image) Hey, Scripting Guy! How can I be notified any time a service goes down?-- RN(image) (image) (image) Hey, RN. As usual, there are a couple different ways you can do this, but perhaps the simplest approach is to create a script that monitors WMI events. We don’t have time to do a detailed explanation of WMI events in this column, but...