Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Incrementally Rename All the Files in a Folder?

Hey, Scripting Guy! I have an unknown number of files in a folder. I need to rename them using this format: ABC_fx.inv, where x is an incremental number. How can I do that?-- RN Hey, RN. You know, one of the Scripting Guys once had an idea for a very different kind of restaurant. Would you walk into this restaurant, sit down at a table, and...

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

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 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 that comes up is this: who ...

How Can I Display a Message Box That Has No Buttons, and That Disappears After a Specified Period of Time?

Hey, Scripting Guy! I would like to display a message box for a set amount of time and then have it disappear. However, I’d prefer that this message box not have a close button, or have anything else that would allow the user to close the message, minimize the message, etc. How can I do that?-- D Hey, D. You know, this question takes us ...

How Can I Move the Oldest File in a Folder to a Different Folder?

Hey, Scripting Guy! How can I move the oldest file in the folder C:\Upload to C:\Download?-- DD Hey, DD. Funny you should mention the word “oldest.” The Scripting Guy who writes this column recently attended a family reunion and, for the first time ever, came face-to-face with the whole idea of getting old. This Scripting Guy has fond ...

How Can I Delete All the Email Sent From a Specific Person?

Hey, Scripting Guy! How can I delete all the email sent from a specific person?-- VP Hey, VP. Ah, yes, deleting email from a specific person; that’s something we Scripting Guys are all too familiar with. For example, the first time the Scripting Guys ever heard of such a thing was back in the early days of Microsoft Mail, when Bill Gates ...

Feedback usabilla icon