Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Locate a Word in a Text File and Then Echo Back That Word and Any Remaining Text?

Hey, Scripting Guy! How can I search for a word in a text file and then, after I find it, echo back that word and any remaining text in the text file?-- KA Hey, KA. Before we begin we’d like to thank the hundreds and hundreds of people who have sent Scripting Guy Jean Ross get well wishes after her unfortunate mishap at Microsoft ...

How Can I Search a Text File for Strings Meeting a Specified Pattern?

Hey, Scripting Guy! How can I search a text file of product IDs and retrieve just those lines that meet a specified pattern?-- WT Hey, WT. Before we get to today’s question we were wondering if anyone else has seen the commercial for the car that features the all-new “heartbeat sensor?” The idea is that, before you open your car door...

How Can I Change the Color of the Scrollbars in an HTA?

Hey, Scripting Guy! How can I change the color of the scrollbars in an HTA?-- IR Hey, IR. How many times have you thought to yourself, “Gee, the Scripting Guy who writes that column is so smart; how come he isn’t rich?” (OK, true, you’ve probably never thought that. But just play along, OK?) Well, it turns out that there’s a very ...

How Can I List All the Members of a Microsoft Outlook Distribution List?

Hey, Scripting Guy! How can I list all the members of a Microsoft Outlook distribution list?-- KH Hey, KH. You know, that’s an interesting question. As it turns out, you can – ow! Hey, let go! Ow! Stop it! Come on, give us a chance; we were just about to tell them! Ow! Um, excuse us. It has come to our attention that, due to a … ...

How Can I Use Windows PowerShell to Be Notified When an Application Terminates?

Hey, Scripting Guy! We have an in-house application that, unfortunately, crashes a lot; when that happens we have to go through a lengthy procedure to restart the program. Using Windows PowerShell, is there any way I can be notified when this application crashes?-- OI Hey, OI. You know, at first we thoughts to ourselves, we thought, “Hey...

Feedback usabilla icon