Scripting Blog [archived]

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

How Can I Change the Legal Warning Message Using a Script?

(image) Hey, Scripting Guy! How can I use a script to change the legal warning message on a computer?-- RB(image) (image) (image) Hey, RB. As you all probably know, when you press Ctrl-Alt-Delete to log on to Windows, you’re typically presented with a logon box. You type your user name, domain, and password in the box, click OK, and away...

How Can I Tell if a Folder Has Any Files with a Specific File Extension?

(image) Hey, Scripting Guy! How can I verify whether or not any files with a specific file extension exist in a folder?-- GM(image) (image) (image) Hey, GM. This is actually a pretty easy thing to do. All we have to do is write a WMI query that includes the path of the folder we want to check as well as the file extension we’re checking ...

How Can I Map a Printer, But Only If the User Doesn’t Have a Local Printer?

(image) Hey, Scripting Guy! I’d like to have a logon script that maps a network printer for each user unless that user already has a local printer. If they have a local printer, I don’t want to add the network printer. Is that possible?-- AG(image) (image) (image) Hey, AG. Not only is that possible, but it’s actually pretty easy, ...

How Can I Access a Type Library From Within a Script?

(image) Hey, Scripting Guy! How can I access a type library from within a script?-- XA(image) (image) (image) Hey, XA. For those of you unfamiliar with the term, a type library is a file or a component that contains type information for a COM object; type information describes the object and the things you can do with it. Among the ...

How Can I Put the User Name into the Footer of a Microsoft Word Document?

(image) Hey, Scripting Guy! How can I put the user name into the footer of a Microsoft Word document?-- RR(image) (image) (image) Hey, RR. That’s an interesting question, and probably the first how-do-I-put-the-user-name-in-the-footer-of-a-Word-document question we’ve ever received. (No, really!) But what the heck; let’s see if we ...