Scripting Blog [archived]

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

How Can I Change the Working Folder of a Script?

(image) Hey, Scripting Guy! My script needs to have the same working folder as the application that the script starts. How can I change the working folder of a script?-- JM(image) (image) (image) Hey, JM. You can change the current (or working) folder of a script simply by setting the value of the Wscript Shell object’s CurrentDirectory ...

How Can I Tell if a Folder Has Any Files with a Specific File Extension?

(image) Hey, Scripting Guy! How can I verify whether or not any files with a specific file extension exist in a folder?-- GM(image) (image) (image) Hey, GM. This is actually a pretty easy thing to do. All we have to do is write a WMI query that includes the path of the folder we want to check as well as the file extension we’re checking ...

How Can I Connect to a Folder When There’s an Apostrophe in the Folder Name?

(image) Hey, Scripting Guy! I’m using the WMI class Win32_Directory to get information about folders on a computer. It works great, except when there’s an apostrophe in the folder name; then, it doesn’t work at all. How can I use WMI to connect to folders that have apostrophes in their names?-- JO(image) (image) (image) Hey, JO. Ah, ...

Can I Use a Script to Determine the Size of a Folder on a Remote Computer?

(image) Hey, Scripting Guy! Can I use a script to determine the size of a folder on a remote computer?-- SS(image) (image) (image) Hey, SS. Boy, you’d think you’d be able to do that, wouldn’t you? Especially if you’ve glanced through the WMI class Win32_Directory and noticed the property FileSize. Based on that, you might think...