Scripting Blog [archived]

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

How Can I Replace Null Values in an Array?

(image) Hey, Scripting Guy! How can I loop through a 12x12 array and replace any null values with a hyphen?-- AM (image) (image) (image) Hey, AM. Sorry for the delay in getting back to you; as it turns out, yesterday was Independence Day (more typically referred to as the Fourth of July) in the good old USA, and the Scripting Guys, along ...

Hey, Scripting Guy! How Can I Get a List of All the Subfolders in a Folder and Then Put That List Into an Array?

(image) Hey, Scripting Guy! How can I get a list of all the subfolders in a folder and then put that list into an array?-- PW (image) (image) (image) Hey, PW. We know how anxious you’ve all been, waiting to hear whether the Scripting Guys were successfully moved from Building 43 to Building 42 (yes, directly across from their old ...

How Can I Delete Duplicate Items From an Array?

(image) Hey, Scripting Guy! How can I delete duplicate items from an array?-- WR(image) (image) (image) Hey, WR. You know, if Microsoft has a weakness – and we’re not saying that it does, we’re just saying if it does – it’s this: we never make mistakes. (What’s that? What about Windows ME? That’s a weird name; couldn’t ...

How Can I Verify That All the Items in a List Also Appear in Another List?

(image) Hey, Scripting Guy! I have a dumb question for you: If I have two lists how can I verify that all the items in list 2 can be found in list 1?-- SS(image) (image) (image) Hey, SS. Trust us; we’ve heard sillier questions. For example, awhile back the Scripting Son came downstairs on a Saturday morning to find the Scripting Dad ...

How Can I Get the Names of 10 Randomly-Selected Files in a Folder?

(image) Hey, Scripting Guy! How can I get the names of 10 randomly-selected files in a folder? I need to do that so I can test and verify our backup and restore policies.-- CS(image) (image) (image) Hey, CS. You know, if you’re interested in things that are random, haphazard, arbitrary, or downright chaotic, well, you came to the right ...