Scripting Blog [archived]

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

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

(image) 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(image) (image) (image) Hey, OI. You know, at first we thoughts ...

How Can I Start a Process and Then Wait For the Process to End Before Terminating the Script?

(image) Hey, Scripting Guy! How can I start a process and then wait until that process quits before terminating the script?-- FG(image) (image) (image) Hey, FG. Before we answer your question, the Scripting Guy who writes this column has a confession to make: he’s the one who ruined Christmas for everyone. Not that he meant to, mind you, ...

How Can I Get the Process ID for an Executable File, But Only If the Process Has a Specified Owner?

(image) Hey, Scripting Guy! How can I get the process ID for a file like MyExecutableFile.exe, but only if a certain user is the owner of that process?-- SC(image) (image) (image) Hey, SC. You know, here at Microsoft ownership is very important; for example, when you sit down to discuss joint projects with people the very first question ...

How Can I Write Output to the Screen that Overwrites Whatever is Currently on the Screen?

(image) Hey, Scripting Guy! How can I write output to the screen that overwrites whatever is currently on the screen?-- KM(image) (image) (image) Hey, KM. If you specifically need to write your output to the command window, well, then we don’t have an answer for you: although we played around with a few things, we never found an easy, ...