Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Search a Word Document for All the Words in Double Brackets?

Hey, Scripting Guy! How can I search a Word document for all the words in double brackets? For example, I need to find words like this: [[failed]]. I then need to save the words I find to a text file.-- PP Hey, PP. You know, one thing that seems to be true of the Scripting Guys is a willingness to do something even when they have no idea ...

How Can I Extract Just the File Name from the Full Path to the File?

Hey, Scripting Guy! How can I extract just the file name from the full path to the file?-- SD Hey, SD. As you might know, Ted Williams was the last major league baseball player to bat .400 for an entire season. Coming into the final day of the year, Williams was actually hitting something like .3997 which, when rounded up, would give him an...

How Can I Search for Folders That Have a Dot in Their Name?

Hey, Scripting Guy! How can I search for folders that have a dot in their name? For example, a folder like Administrator.name or Folder.old?-- DU Hey, DU. You know, if your intention was to trick the Scripting Guys (not that tricking the Scripting Guys would be anything to brag about), well, you almost succeeded. That’s because, upon ...

How Can I Change All the Lowercase Letters in an Excel Worksheet to Uppercase Letters?

Hey, Scripting Guy! How can I change all the lowercase letters in an Excel worksheet to uppercase letters?-- BC Hey, BC. Have you ever heard the old expression, “If you want something done you have to do it yourself”? Well, to tell you the truth, we Scripting Guys had heard of that old expression, but we never paid much attention to it...

How Can I Get a Script to Delete Itself?

Hey, Scripting Guy! I have a script for installing a printer that I give to my end users. When the script finishes, I’d like it to be able to delete itself. How can I get a script to delete itself?-- EA Hey, EA. You know, that’s an interesting idea: disposable scripts, just like disposable razors or disposable cameras. Actually, they’...

Feedback usabilla icon