Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Read the Contents of a Text File and Then Declare the Contents as Variables?

Hey, Scripting Guy! How can I read the contents of a text file, and then declare those contents as variables?-- TC Hey, TC. Before we begin, did you really ask us this question? We’re positive that you did, but, the way things have been going lately, we can’t be too sure. For example, by now everyone has heard that Scripting Guy Jean ...

How Can I Map Drive X on a Computer, But Only If Drive X isn’t Already in Use?

Hey, Scripting Guy! How can I map drive X on a computer, but only if drive X isn’t already in use?-- PN Hey, PN. You know, this is almost too good to be true (but, sadly, it is true). The Scripting Guy who writes this column was busy writing this column. And because today just happens to be Friday the 13th the theme for the day was, as ...

How Can I Remove the Password When Opening an Excel Spreadsheet?

Hey, Scripting Guy! How can I remove the password when opening an Excel spreadsheet?-- JE Hey, JE. You know, it’s finally happened: after two-and-a-half years of writing this column we’ve finally run out of things to talk about. The “heartbeat sensor” that can tell you whether someone is hiding in the backseat of your car? We talked...

How Can I Get a List of All the Users Who Have a Process Open on a Computer?

Hey, Scripting Guy! How can I get a list of all the users who have a process open on a computer?-- RE Hey, RE. You know, over the past 5 years the number of people who watch the news on the major networks (ABC, NBC, and CBS) has dropped precipitously; the number of people who read the newspaper each day has fallen even more dramatically. And...

How Can I Filter Outlook Messages By Email Address?

Hey, Scripting Guy! I read your article on filtering email messages in Microsoft Outlook, and it’s almost what I need, but not quite. What I really need to know is this: how can I filter Outlook messages by the email address of the person who sent the message?-- SJS Hey, SJS. Say, you weren’t by any chance at the Columbia Athletic Club ...