Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Apply a New Template to a PowerPoint Presentation?

Hey, Scripting Guy! My company has just created a new PowerPoint template, and has decided that we need to use this template for all our presentations. How can I apply this new template to all the presentations in my C:\Presentations folder?-- OI Hey, OI. You know, this morning the Scripting Guy who writes this column did what he does ...

How Can I Dynamically Show Available Drive Letters in a List Box?

Hey, Scripting Guy! I’m using an HTA as a drive-mapping application. I’d like to be clever about this and have the available drive letters appear in a list box. How can I dynamically show all the drive letters available on a computer?-- JT Hey, JT. You know, just the other day the Scripting Guy who writes this column was lamenting a ...

How Can I Count the Number of Users in a Group?

Hey, Scripting Guy! How can I count the number of users in an Active Directory group?-- TP Hey, TP. You know, it’s our sad duty to confirm that the reports currently sweeping the Internet are true. Without wishing to alarm anyone, we must admit that one of the Around the World With Dr. Scripto Bobblehead pictures appears to be a fake! (...

How Can I Move Files Off a User’s Desktop and Into Specified Folders?

Hey, Scripting Guy! For various reasons, we don’t want our users storing “loose” files on their desktop. How can I write a script that will take all the files on the user’s desktop and, based on the file extension, move those files to the appropriate desktop folder? For example, if I have a file with a .doc file extension I’d like ...

How Can I Parse a Comma-Separated Values File?

Hey, Scripting Guy! I have a text file which consists of individual fields separated by commas. I need to look at the second field in each line and, if it includes the word Everyone, I then need to take the sixth field in the line and write that value to a second text file. How can I do that?-- RP Hey, RP. You know, a lot of you are ...