Scripting Blog [archived]

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

How Can I Use a Logon Script to Remove All Mapped Drives?

(image) Hey, Scripting Guy! How can I use a logon script to remove all mapped drives each time a user logs on?-- VS (image) (image) (image) Hey, VS. You know, we’re glad you specifically mentioned the term “logon script” in your question. Why? Well, one of the drawbacks to mapping and unmapping network drives is the fact that there ...

How Can I Open Word with the Cursor Positioned at the Start of a Specified Line?

(image) Hey, Scripting Guy! How can I open Word with the cursor positioned at the start of a specified line?-- PS(image) (image) (image) Hey, PS. You know, we Scripting Guys have decided that we don’t like Microsoft Word anymore. How come? Well, as Scripting Guys we like to find solutions to seemingly-unsolvable problems: any time we can...

How Can I Retrieve Just Audit Failures, Warnings, and Errors from My Event Logs?

(image) Hey, Scripting Guy! How can I retrieve just audit failures, warnings, and errors from my event logs?-- OG(image) (image) (image) Hey, OG. You know, just for the heck of it, we decided to check the event logs on one of our computers to see whether this was a task worth doing. In the Security event log on this machine we had 42,815 ...

How Can I Center Text in an Excel Cell?

(image) Hey, Scripting Guy! How can I center text in an Excel cell?-- MV(image) (image) (image) Hey, MV. You know, every now and then we get asked a question and we think to ourselves, “Wow, how many times do you suppose we’ve answered this question?” And, of course, when we go to double-check we find out that we’ve never answered ...