Scripting Blog

A place to learn about PowerShell and share stories of automation

Hey, Scripting Guy! How Can I Create File Names Based on Their Time Stamp?

Hey, Scripting Guy! How can I create a file name from the date? I have this application that creates a log file, and every hour I would like to save that log file as a file whose name is generated from the current time stamp. Can this be done?- RH Hi RH, Ever since I read your e-mail message, I have had this old Rolling Stones tune stuck in...

Hey, Scripting Guy! How Do I Back Up Files That Have Been Modified in the Last Day?

Hey, Scripting Guy! I have a USB drive that I use for backup purposes on my computer. Because it appears that Windows Vista does not have a backup program that I can use, I thought it would be useful to write a script using Windows PowerShell to back up the computer. To make things simple, I have all my data in a folder called "data." I only...

Hey, Scripting Guy! How Can I Delete and Manage PDF Files?

Hey, Scripting Guy! We are implementing a document management system at work, and users are no longer allowed to store PDF files. I need to search a folder for the existence of PDF files. If the folder contains any PDF files, I want to delete them. If on the other hand there are no PDF files in the folder, I would like to create a file ...

Hey, Scripting Guy! Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (12/05/08)

Deleting Old Folders Programmatically   Hey, Scripting Guy! I need to delete some folders that exist under a root folder based upon how long they have been in existence. I do not need to delete the root folder, only the child folders. What is happening is that our logging routine creates new logs every hour, and creates a new log ...

Hey, Scripting Guy! How Can I Document Printers?

Hey, Scripting Guy! I do not know about you, but does it seem that printers are a major pain in the dark side? I mean, they seem to multiply faster than bacteria. They are all just different enough to cause maintenance problems, and forget about trying to keep track of toner cartridges. Do you have any ideas that could help?- HR Hi HR, Don...

Feedback usabilla icon