How Can I Start an Application From an HTA?

Hey, Scripting Guy! Is there an alternative to the Wscript.Shell command for HTAs? I need to run an application and specify the file to open.– DL Hey, DL. Yes, we do know of an alternative to the Wscript.Shell command that will work in HTAs, and we’ll show you that in a minute. Before we do… Read more

How Can I Determine an Attribute’s Data Type and Whether It is Single- or Multi-Valued?

Hey, Scripting Guy! How can I query the Active Directory schema for an attribute’s data type and whether it is single-valued or multi-valued?– MS Hey, MS. You know, this turned out to be one of those questions that drive us crazy: after all, it seemed like it would be so easy to answer. As you’ve… Read more

How Can I Determine Which Drives are Mapped to Network Shares?

Hey, Scripting Guy! How can I determine which drives on a computer are mapped to network shares?– CP Hey, CP. OK, you better sit down, because what we’re about to say will shock you: if you want to determine which drives on a computer are mapped to network shares, don’t use the Win32_MappedLogicalDisk class. Oh,… Read more

How Can I Determine if an OU is Blocking Group Policy Inheritance?

Hey, Scripting Guy! How can I determine if an OU has the Group Policy property Block Policy Inheritance box checked?– PP Hey, PP. You know, sometimes you wait all your life for a situation to arise, and then it never arises. For example, one of the Scripting Guys happens to know all nine verses to… Read more

How Can I Delete a Backup File Created on the Previous Day?

Hey, Scripting Guy! Each day we have a program that creates a file with a name similar to this: backup_20050607.bak. How can I delete the previous day’s file?– JC Hey, JC. Hmmm, a script that goes out and automatically deletes whatever happened the day before. Boy, could we have used a script like that a… Read more

How Can I Remove a Group from the Local Administrators Group?

Hey, Scripting Guy! How can I remove a group from the local Administrators group?– SB Hey, SB. One of the Scripting Guys has very vague memories of an old TV show called Branded, in which the hero (played by Chuck Connors) was accused of cowardice and then dishonorably discharged from the US Cavalry. About all… Read more

How Can I Read a Text File on a Remote Computer?

Hey, Scripting Guy! How can I read a text file on a remote computer?– BM Hey, BM. We have a confession to make: we’re using you and your question for our own nefarious purposes. Earlier this week we answered a question about reading the last line in a group of text files; in our answer… Read more

How Can I Verify That a Folder Has Files in It and, If So, Delete Those Files?

Hey, Scripting Guy! How can I verify that a certain folder (C:\TestLog) has files in it and, if so, delete all those files?– DC Hey, DC. Before we begin we should point out that – when using WMI – it doesn’t matter whether or not a folder has any files in it: you can still… Read more

Hey, Scripting Guy! How Can I Configure the Hide From Exchange Address Lists Property for All the Contacts in a Domain?

Hey, Scripting Guy! How can I configure the Hide From Exchange Address Lists property for all the contacts in a domain?– MM Hey, MM. You know what the say: you can run, but you can’t hide (especially from Microsoft Exchange!). But what they forgot to add is that you can hide, as long as you’ve… Read more

How Can I Add the Last Lines from a Group of Text Files to a Word Document?

Hey, Scripting Guy! How can I take the last line in a group of text files and paste that information into a Word document?– JV Hey, JV. You know, one thing we try to do in this column is focus on practical system administration tasks. We’ll deviate from that focus every now and then, but… Read more