Scripting Blog [archived]

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

How Can I Monitor Event Log Messages for Specific Words?

(image) Hey, Scripting Guy! How can I monitor event log messages for a specific word or phrase?-- GH(image) (image) (image) Hey, GH. You know, now that the 2007 Scripting Games are over (have we mentioned that the 2008 Games are just a year away?) it’s time for the Scripting Guys to rejoin the real world. Before we answer your question, ...

How Can I Count the Number of Times a Word Appears in a Log File?

(image) Hey, Scripting Guy! How can I count the number of times the word Failure appears in a log file? There’s one catch, though: the log file simply writes its events one after another, creating one big, giant line of text.-- FS(image) (image) (image) Hey, FS. According to the rest of your email, your log file looks something like this...

How Can I Retrieve Information About the Latest Event Added to an Event Log?

(image) Hey, Scripting Guy! How can I retrieve information about the latest event added to an event log?-- HG(image) (image) (image) Hey, HG. You know, it seems like only yesterday that someone was asking us how they could find the oldest event in an event log. And we remember how we told them that - oh, right: it was only yesterday, wasn...

How Can I Find the Date of the Oldest Event in an Event Log?

(image) Hey, Scripting Guy! How can I find the date of the oldest event in an event log?-- JL(image) (image) (image) Hey, JL. You know, you just had to make a reference to “old” in your question, didn’t you? Just today one of the Scripting Guys received a letter from the American Association of Retired Persons (AARP). Although the ...

How Can I List All the Files in a Folder, Ordered By Creation Date?

(image) Hey, Scripting Guy! How can I list all the files in a folder, ordered by creation date?-- CL(image) (image) (image) Hey, CL. You know, if we were ambitious and hard-working, we’d sit down and write you a script that uses WMI to return all the files in a folder. That script would grab information about all those files and store ...