Scripting Blog [archived]

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

Hey, Scripting Guy! How Can I Map a Drive Based on the Computer’s Subnet?

(image) Hey, Scripting Guy! I have a CAD staff that occasionally travels between sites. What I would like to do, in a logon script, is map a set of drives based on their current location, that is, their current subnet. I need the script to first check and see if the drives are already mapped; if so then the script should just leave the ...

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

Hey, Scripting Guy! How Can I Enable Users to Change File Extensions Using the SendTo Command?

(image) Hey, Scripting Guy! Here’s what I would like to do. I would like to put a script in the SendTo folder that would enable a user to easily change the file extension for a file. (Typically our users hide the file extensions, which makes it difficult for them to change those extensions when they need to.) However, I haven’t ...

Hey, Scripting Guy! How Can I Create a Disk Quota That Gives the User Unlimited Disk Space?

(image) Hey, Scripting Guy! Your article "Managing Disk Quotas in Windows Server 2003 and Windows XP" is quite good but it leaves out one important detail: how can you specify an unlimited disk quota for a user?-- CA(image) (image) (image) Hey, CA. You know, it’s funny. When we received this question, we had no idea what the answer was. ...