Scripting Blog [archived]

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

How Can I Rename a File Every Day, Using the Current Date as Part of the File Name?

(image) Hey, Scripting Guy! I have a file that has the name BackupFile-06122007.txt, where the 06122007 represents yesterday’s date (June 12, 2007). Each morning I would like to run a script that changes the name of that file so that it uses today’s date: BackupFile-06132007.txt. How can I do that?-- GZ (image) (image) (image) Hey, GZ...

How Can I Get a List of All the PDF Files in a Folder and Its Subfolders?

(image) Hey, Scripting Guy! How can I get a list of all the .PDF files (only the file names; I don’t want the file path or file extension) in a folder and its subfolders, and then put that list into a text file?-- PS (image) (image) (image) Hey, PS. You know, PS, this is actually a hard question; far harder and far more complicated than ...

How Can I Monitor the Number of Files in a Folder?

(image) Hey, Scripting Guy! We have a third-party application that rarely crashes; however, when it does crash it seriously disrupts our business. We can always tell when the application is getting ready to crash; at that point, one of its directories starts filling up with log files. How can we be notified any time the number of log files ...