Scripting Blog

A place to learn about PowerShell and share stories of automation

Hey, Scripting Guy! How Can I Create a Bunch of .WAV Files in a Folder?

Hey, Scripting Guy! For testing purposes I need to create a bunch of empty .WAV files in a folder. How can I write a script that will create those files for me?-- ZL Hey, ZL. You know, yesterday was a very exciting day for the Scripting Guy who writes this column: he got to work from home, just like Scripting Guy Jean Ross does on a regular...

Hey, Scripting Guy! How Can I Make the Name of the File the First Line of Each Text File in a Folder?

Hey, Scripting Guy! How can I make the name of the file the first line of each and every text file in a folder?-- DJ Hey, DJ. And, by the way, we hope your day is going better than ours. Are we having a bad day? You might say that. For example, this morning the Scripting Guy who writes this column zoomed right past the grocery store where ...

Hey, Scripting Guy! How Can I Remove All the Network Printers on a Computer?

Hey, Scripting Guy! Is it possible to delete or remove all network printers from a workstation with a VBScript script, similar to the way you removed all the network drives on a computer?-- WDC Hey, WDC. If you’ve been following our daily TechEd preview report, then you know that the Scripting Guys have been busy preparing for their ...

Hey, Scripting Guy! How Can I Determine the Value of the Last Cell in an Office Excel Range?

Hey, Scripting Guy! How can I determine the value of the last cell in a range like C1:C10?-- MJdR Hey, MJdR. You know, just a few days ago word leaked that a Federal Emergency Management Agency (FEMA) press conference held to discuss the US government’s response to the recent spate of wildfires in California was a fake. Instead of having ...

Hey, Scripting Guy! How Can I Use Windows PowerShell to Delete All the Files in a Folder Older Than 90 Days?

Hey, Scripting Guy! In Windows PowerShell, how can I determine the number of days difference between two dates? I want to be able to delete all the files in a folder that are more than 90 days old.-- JN Hey, JN. You know, today is October 31st and, in the US at least, it’s the day when the dark underworld takes over: witches parade ...