Scripting Blog [archived]

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

How Can I List All the Files on a User’s Desktop?

(image) Hey, Scripting Guy! How can I list all the files on a user’s desktop?-- BT(image) (image) (image) Hey, BT. So you thought you could fool the Scripting Guys, did you? Well, you did, at least for awhile. As is so often the case with the Scripting Guys we took one look at your question and thought, “Let’s answer this one; this ...

How Can I Delete a Folder That Has an Apostrophe in the Name?

(image) Hey, Scripting Guy! How can I delete a folder that has an apostrophe in the name?-- JH(image) (image) (image) Hey, JH. Ah, yes, the apostrophe: every script writer’s arch-nemesis. The apostrophe seems like such a simple little character, but don’t let its appearance fool you: the apostrophe (or the single quote) is probably the...

How Can I Verify That a Folder Has Files in It and, If So, Delete Those Files?

(image) Hey, Scripting Guy! How can I verify that a certain folder (C:\TestLog) has files in it and, if so, delete all those files?-- DC(image) (image) (image) Hey, DC. Before we begin we should point out that - when using WMI - it doesn’t matter whether or not a folder has any files in it: you can still tell WMI to delete all the files ...

How Can I Delete a Folder and All Its Subfolders?

(image) Hey Scripting Guy! How can I delete a folder and all its subfolders?-- FB(image) (image) (image) Hey, FB. You know, a lot of people think the Scripting Guys know everything there is to know about scripting. Let’s put it this way: we wish. In fact, it’s only when we begin to think that we do know something about scripting that ...