Scripting Blog [archived]

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

How Can I Open an Excel Workbook and Retrieve the Names of All the Worksheets?

(image) Hey, Scripting Guy! How can I open an Excel workbook and retrieve the names of all the worksheets?-- JG(image) (image) (image) Hey, JG. Itโ€™s the first day back after a three-day weekend, and this morning all the Scripting Guys stumbled into the office and just stared blankly into space. (All in all, pretty much business as usual...

How Can I Change the “Copy Music to This Location Folder” in Windows Media Player?

(image) Hey, Scripting Guy! How can I change the Copy music to this location folder in Windows Media Player?-- BD(image) (image) (image) Hey, BD. You know, a lot of people think that the reason we Scripting Guys donโ€™t do very much work is because weโ€™re just plain lazy. Those people are right. However, what we tell our bosses is this: ...

How Can I Get Just the User Name When Using the Win32_ComputerSystem Class?

 (image) Hey, Scripting Guy! Iโ€™m using the Win32_ComputerSystem class to get the name of the logged-on user. The name comes back formatted like this: Domain\Name. How can I extract just the user name?-- KW(image) (image) (image) Hey, KW. As our much-beloved and highly-respected editor reminded us the other day, instead of spending ...

How Can I Extract Word Paragraphs That Use a Specific Style?

(image) Hey, Scripting Guy! How can I save (to a separate file) all the paragraphs in a Word document that are formatted using a particular style, like Heading 1?-- RN(image) (image) (image) Hey, RN. You know, when we first read this question we thought, โ€œInteresting. But why would you ever want to do something like that?โ€ And then one...

How Can I Use ADO to Open a Text File That has Spaces in the File Name?

(image) Hey, Scripting Guy! How can I use ADO to open a text file that has spaces in the file name?-- TL(image) (image) (image) Hey, TL. You might not even remember sending us this question; to say itโ€™s been awhile would be an understatement. (You should have seen all the dust and cobwebs we had to brush off this question before we could...