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 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 Change a File That’s Found in a Folder and in All Its Top-Level Subfolders?

(image) Hey, Scripting Guy! I need a little help. I have one top folder with many subfolders ; the subfolders are all top-level subfolders like C:\Scripts\Folder1 and C:\Scripts\Folder2. In each subfolder I have a text file with the same name. I need to open that text file in each folder and change a couple of characters. Is there any way ...

Hey, Scripting Guy! How Can I Move Files Based on a Portion of the File Name?

(image) Hey, Scripting Guy! I have tens of thousands of files that all have a file name that includes a number bounded by two underscore characters; for example, P_19_L00.jpg. I need to figure out which number is embedded in a file name, then move that file to a folder named after that number. In this case, that means moving P_19_L00.jpg to ...