Scripting Blog [archived]

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

How Can I Replace Selected Lines in an XML File?

(image) Hey, Scripting Guy! How can I read lines 56 to 62 in one XML file, and replace those with lines 56 to 62 taken from another XML file?-- JA(image) (image) (image) Hey, JA. First of all, we’d like to thank you for your question; in addition, we’d like to welcome you and everyone else to today’s Open House in honor of the 501st ...

How Can I Subtract a Specified Number of Days from a UTC Value?

(image) Hey, Scripting Guy! Suppose I get a date-time value in UTC format. How can I subtract x number of days from that value?-- MW(image) (image) (image) Hey, MW. First of all, we’d like to thank you for your question; in addition, we’d like to welcome you and everyone else to today’s Open House in honor of the 500th Hey, Scripting...

How Can I Tell If a Specified Worksheet Exists in an Excel Workbook?

(image) Hey, Scripting Guy! How can I tell if a specified worksheet exists in an Excel workbook?-- MVK(image) (image) (image) Hey, MVK. Back when he was in high school (that was about 3 or 4 years ago, of course), the Scripting Guy who writes this column was kind of half-watching a variety show on TV. The show featured a man and his dogs...

How Can I Set the Default Printer Based on the IP Address of the Computer?

(image) Hey, Scripting Guy! How can I set the default printer based on the IP address of the computer?-- TT(image) (image) (image) Hey, TT. You’ll have to forgive us for being a little distracted this morning. Last night the Scripting Guy who writes this column went to the gym with his 16-year-old son. For the first time ever, the ...

How Can I Create a Logon Script That Will Open a User’s Mapped Drives?

(image) Hey, Scripting Guy! How can I create a logon script that will open a user’s mapped drives?-- KZ(image) (image) (image) Hey, KZ. You know, a lot of people think we decided to write this column because we wanted yet another way to tell people about scripting. That’s partially true; however, another reason there’s a Hey, ...