Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Convert a Number to a Date in Excel?

Hey, Scripting Guy! How can I convert a number in Excel to a date; for example, how can I convert 40806 to 4/8/2006?-- JM Hey, JM. You probably didn’t know this, but one of the Scripting Guys has a brother who’s an actor. As every actor knows, nepotism is pretty prevalent in the acting world. Well, it’s a good thing the Scripting Guys...

How Can I Locate and Replace Information for a Specific Item in a Spreadsheet?

Hey, Scripting Guy! In an Excel spreadsheet, how can I locate and replace information for a specific computer?-- BB Hey, BB. You know, there’s an old saying that goes, “If all you have is a hammer then everything looks like a nail.” Well, all we Scripting Guys have at the moment is some code for modifying a record in a database. So ...

How Can I Determine the Path to the Folder Where a Script is Running?

Hey, Scripting Guy! How can I determine the path to the folder where a script is running? What I’d like to do is have the script automatically open the folder where the script is running.-- PD Hey, PD. You know, for the Scripting Guys this question - as do so many of the questions we receive - falls under the category Why Didn’t We ...

How Can I Rename a Word Document Using the First Three Characters in That Document?

Hey, Scripting Guy! How can I open a Word document, read the first three characters, and then rename the file using those three characters?-- DG Hey, DG. To tell you the truth, we always get a chuckle any time we get a question that asks for our help in renaming files or folders. Why? Well, the Scripting Guy who writes this column has ...

How Can I Count the Number of Words in a Text File?

Hey, Scripting Guy! How can I count the number of words in a text file?-- LA Hey, LA. You know, this is one of those questions where the Scripting Guys outsmarted themselves. (Not that outsmarting the Scripting Guys is particularly hard to do, mind you.) For one thing, we’re writing this column on a Friday, and we always look for an easy ...