Scripting Blog [archived]

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

Hey, Scripting Guy! How Can I Copy a File to a Removable Drive If I Don’t Know the Drive Letter of That Drive?

(image) Hey, Scripting Guy! How can I determine if a computer has a removable drive attached to it and, if it does, copy a file to that drive? I have no way of knowing what the drive letter of that removable drive would be, assuming it even exists.-- SN(image) (image) (image) Hey, SN. You know, when you live in Seattle you don’t really ...

Hey, Scripting Guy! How Can I Find the Number (and Size) of All the Files Recently Modified or Added to a Computer?

(image) Hey, Scripting Guy! I'm looking for a script that can search a file server and list the number and total size of files that have been recently modified or added to the server. Any help would be appreciated!-- KT(image) (image) (image) Hey, KT. Before we launch into today’s column we thought we should tell you that the rumor is ...

Hey, Scripting Guy! How Can I Return a List of All the Folders Whose Name Starts With a Specified String Value?

(image) Hey, Scripting Guy! How can I find all the folders that start with a specific string? For example, given the string 123 the script would find folders 123000 through 123999.-- MD(image) (image) (image) Hey, MD. Here in the US we’re still busy trying to figure out who’s going to run for President. (Figure out who will actually be...

Hey, Scripting Guy! How Can I Write a Message to All the Empty Files in a Folder?

(image) Hey, Scripting Guy! I need to search a certain directory for files with a size of 0 KB, then replace the non-existent text in those files with an error message like this one: "File did not save correctly." I have been searching for the answer myself and can't seem to grasp it. Can you help me on this one?-- CE(image) (image) (image...

Hey, Scripting Guy! How Can I Verify That a User Entered a Valid Drive Letter?

(image) Hey, Scripting Guy! How can I make sure that data entered into an InputBox has the form X:, where X is any alphabetic character? That’s important, because I need to use this string to map logical drives in a script. The script should validate any string such as D:, E:, or F: but flag as incorrect any string such as 9:, !:, 22: etc...