Scripting Blog [archived]

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

Hey, Scripting Guy! How Can I Read a Text File and Extract All the Text Enclosed in Double Quote Marks?

(image) Hey, Scripting Guy! I’m trying to write a script that can extract all the values found between a set of double quote marks. I know how to read the text file, and I know how to output any information that I find. However, I can’t figure out how to extract all the characters between a set of double quote marks. Can you help?-- TM(...

Hey, Scripting Guy! How Can I Use Windows PowerShell to Determine the Number of Lines in a Text File?

(image) Hey, Scripting Guy! I’m using Windows PowerShell to determine the record count (i.e., the number of lines) in a text file I just created. If the file has 2 lines, no problem; my script reports back a value of 2. If the file only has 1 line, however, I get back what looks to be the number of characters in the file. In other words, ...

Hey, Scripting Guy! How Can I Install Fonts Using a Script?

(image) Hey, Scripting Guy! Is there any way I can install a font using VBScript?-- RS(image) (image) (image) Hey, RS. As a general rule, the Scripting Guy who writes this column steers clear of popular culture. (Actually, it’s not just a general rule; popular culture has a restraining order which requires him to stay at least 100 yards ...

Hey, Scripting Guy! How Can I Pass Command-Line Arguments to a Batch File Started From a Script?

(image) Hey, Scripting Guy! I am trying to write a script that requests multiple pieces of information from a user; I then want to call a batch file, using each piece of information as a separate command-line argument. Unfortunately, though, I can’t get this to work correctly. Can you help?-- BP(image) (image) (image) Hey, BP. You know, ...

Hey, Scripting Guy! How Can I Randomly Assign a Font to Characters in a Word Document?

(image) Hey, Scripting Guy! I’ve come up with a way to imitate handwriting in a document, but I need some help. Because real handwriting is characterized by variability, I had the idea of using four slightly-different fonts, taken from my actual handwriting, and then randomly assigning a font to each letter. I think that would imitate ...