Scripting Blog [archived]

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

Why Does My Performance Monitoring Script Keep Returning the Same Incorrect Values?

(image) Hey, Scripting Guy! I’m using a script to monitor process performance, but every time I run the script the percent processor time for all the processes comes out as 0. What am I doing wrong?-- JL(image) (image) (image) Hey, JL. We’ve simplified your script a bit to better illustrate the problem you’re running into. (And don...

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 ...

How Can I Monitor for Different Types of Events With Just One Script?

 (image) Hey, Scripting Guy! Is there any way to monitor a folder for file creations and deletions, all with just one script? -- HA(image) (image) (image) Hey, HA. By the way, thanks for the question: you temporarily saved us from answering a different question, one that was proving a bit difficult thanks to some surprising ...