Hey, Scripting Guy! How Can I Determine If Any of the Files in a Folder Have Been Modified in the Past 90 Days?

Hey, Scripting Guy! On my file servers I periodically want to check a folder to see if that folder or any of its subfolders have files that are no longer being updated. What I’d like to do is check each file in each folder to see if they’ve been modified in the past 90 days…. Read more

Hey, Scripting Guy! How Can I Remove Duplicate Values From a Pair of Text Files?

Hey, Scripting Guy! I have two text files that contain numbers. I need to write a script that can determine whether a given number exists in both of these text files. If it does, I need to delete that line from each of the two files. How do I do that?– KT Hey, KT. Before… Read more

Hey, Scripting Guy! How Can I Change the Background Color of a Text Box?

Hey, Scripting Guy! I have an HTA that we use for data entry. On this form, some of the fields are mandatory and some of them are optional. I’d like to indicate the mandatory fields by making those text boxes a different color than the text boxes used for the optional fields. How do I… Read more

Hey, Scripting Guy! How Can I Delete Files That Are a Specified Number of Hours Old?

Hey, Scripting Guy! I’ve seen scripts that let you delete all the files in a folder that are X number of days old. I have a different problem: I’d like to delete files that are X number of hours, or even X number of minutes, old. How can I do that?– DF Hey, DF. Did… Read more

Hey, Scripting Guy! How Can I Replace Text That Includes Double Quote Marks and a Tab Character?

Hey, Scripting Guy! I read one of your columns on replacing text in a file and I found it very useful. However, I have a somewhat more-complicated need: I want to replace text that includes both double quote marks and a tab character. How can I do that?– FC Hey, FC. Your know, as anyone… Read more

Hey, Scripting Guy! How Can I Map Drives Based on Membership in an Active Directory Group When the User Belongs to Multiple Groups?

Hey, Scripting Guy! In yesterday’s column you showed a sample script that mapped a drive based on membership in an Active Directory group; along the way, you brought up the possibility of a user belonging to more than one group. “Suppose you have two groups,” you said. “What happens if a user is a member… Read more

Hey, Scripting Guy! How Can I Map Drives Based on Membership in an Active Directory Group?

Hey, Scripting Guy! I need to map a drive based on a user’s membership in a particular Active Directory group. However, I have a twist as well: I need to map a different drive depending on whether or not the user is a manager. In other words, I need to map a drive based on… Read more

How Can I Start a Script in a Hidden Window?

Hey, Scripting Guy! How can I start a script in a hidden window?– OT Hey, OT. You know, today is kind of a disappointing day for the Scripting Guys, or at least for the Scripting Guy who writes this column. As we noted yesterday, the Seattle area was hit by a freak “Pineapple Express” rainstorm… Read more

Hey, Scripting Guy! How Can I Cut a Row From One Office Excel Spreadsheet and Paste That Row Into Another Spreadsheet?

Hey, Scripting Guy! How can I cut a row from an Office Excel spreadsheet and paste it into the first unused row in another Excel spreadsheet?– NC Hey, NC. We apologize if today’s column feels a little damp; as it turns out, those of us in the Seattle area are experiencing another one of the… Read more

Hey, Scripting Guy! How Can I Start an Application From a Windows PowerShell Script, Then Pause the Script Until the Application Has Terminated?

Hey, Scripting Guy! In Windows PowerShell, how can I start another application, then have my script pause until that application has terminated?– AD Hey, AD. Before we answer today’s question, we’d like to make an announcement: the Scripting Guys need friends! No, not those kind of friends. Well, come to think of it, we could… Read more