Scripting Blog [archived]

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

Hey, Scripting Guy! How Can I Use Windows PowerShell to Replace Characters in a Text File?

(image) Hey, Scripting Guy! Using Windows PowerShell, how can I replace all the asterisks in a text file with some other character?-- RC (image) (image) (image) Hey, RC. You know, a lot of people ask the Scripting Guy who writes this column, “How do you do it? How do you manage to write a new column each and every day?” (Of ...

Hey, Scripting Guy! How Can I Extract Specific Information From a Word Document and Then Use That Information to Rename the Document?

(image) Hey, Scripting Guy! I have a bunch of Word documents in a folder. I need to open each document, read in some information from the first two lines, then use that information to rename the file. However, I’m having some trouble getting this to work. Can you help me?-- TG(image) (image) (image) Hey, TG. As devoted readers of Hey, ...

Hey, Scripting Guy! How Can I Add a Record to a Database Using Windows PowerShell?

(image) Hey, Scripting Guy! Awhile back you showed us how we could use Windows PowerShell to retrieve data from a Microsoft Access database. I’m now trying to add data to a database using PowerShell, but I can’t get the script to work. Any chance you could show me how to add a record to a database using Windows PowerShell?-- AB(image) (...

Hey, Scripting Guy! How Can I Search For a Folder and Return the Folder Path?

(image) Hey, Scripting Guy! How can I search a computer for a folder, and return the folder’s complete path?-- AW(image) (image) (image) Hey, AW. We know a lot of you have been sitting on pins and needles, waiting for this announcement, so we won’t waste any time: yes, the Scripting Son has officially been accepted by the University of...

Hey, Scripting Guy! How Can I Tally All the Items in a Microsoft Word Document?

(image) Hey, Scripting Guy! We have an application that repeatedly runs a test and writes the result of each test pass to a Microsoft Word document. Periodically I’d like to be able to use a script to tally up the number of times a test passed, the number of times a test failed, and the number of times a test failed to run. How can I write...