Scripting Blog [archived]

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

How Can I Convert a DN to this Format: finance.fabrikam.com/Users?

(image) Hey, Scripting Guy! How can I convert a DN to this format: finance.fabrikam.com/Users?-- CW(image) (image) (image) Hey, CW. You know, this is a pretty good question; in fact, we should have used it for the Winter Scripting Games. Ah, but, on second thought, maybe it’s a good thing we didn’t use it. Why not? Well, because all ...

How Can I Determine When a Removable Drive Gets Connected?

(image) Hey, Scripting Guy! How can I determine when a USB flash drive gets connected?-- PS(image) (image) (image) Hey, PS. OK, we admit it: the Scripting Guys are lazy. (Especially on a Friday, which is the day when we have to write our Monday column.) There might be a way to monitor specifically for the insertion of a USB flash drive; ...

How Can I Log the Start Time and the End Time of the Screensaver?

(image) Hey, Scripting Guy! How can I log the start time and the end time of the screensaver?-- JS(image) (image) (image) Hey, JS. You know, one of the Scripting Guys (hey, who said “It must be Greg”?) is old enough to remember the days when screensavers first came out. Back then a script like this would have been meaningless: after ...

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