Scripting Blog [archived]

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

How Can I Determine the Size of the My Documents Folder?

(image) Hey, Scripting Guy! How can I determine the size of the My Documents folder?-- SC(image) (image) (image) Hey, SC. The My Document folder is actually just another folder on the hard disk, one with a path similar to this: C:\Documents and Settings\kenmyer\My Documents. Of course, the actual path will vary depending on the name of the...

How Can I Copy and Rename a Worksheet in the Same Workbook?

(image) Hey, Scripting Guy! I’d like to copy one of the worksheets in an Excel workbook and then paste that copy into the very same workbook; once it’s pasted it, I’d like to rename it. Can I do that?-- JG(image) (image) (image) Hey, JG. Of course you can do this; after all, if you can do something in Excel it’s almost 100% ...

How Can I Clear a List Box in an HTA?

(image) Hey, Scripting Guy! How can I clear a list box in an HTA?-- AK(image) (image) (image) Hey, AK. For those of you who aren’t familiar with the term, an HTA - among other things - is a way to use Internet Explorer to provide a graphical user interface for your scripts. (If that still doesn’t answer your questions, don’t despair...

How Can I Add a Word to a Text File if That Word Isn’t Already in the File?

(image) Hey, Scripting Guy! How can I check a text file to see if a word appears in that file and, if it doesn’t, add the word to the file?-- JO(image) (image) (image) Hey, JO. We seem to have gotten quite a few questions on this topic lately. You mentioned adding words to a custom dictionary for Microsoft Word; other people mentioned ...

How Can I Write Double Quotes to a Text File?

(image) Hey, Scripting Guy! I’m using the FileSystemObject to create an XML file. However, I need to put double quote marks around some of the items in that file. How do I do that?-- JP(image) (image) (image) Hey, JP. According to your email, you’re trying to write the following line to your XML file:<? xml version = "1.0" encoding...