Scripting Blog

A place to learn about PowerShell and share stories of automation

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. If I find a folder in which none of the files have been ...

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 we get started today, we have a little business to take care of. ...

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 do that?-- IU Hey, IU. You know, for a large number of...

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 you see where some researchers are predicting that, by the year 2050, ...

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 who’s ever read Hey, Scripting Guy! could tell you...

Feedback usabilla icon