Scripting Blog [archived]

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

How Can I Determine the Drive Letter for the Drive My Script is Currently Running On?

(image) Hey, Scripting Guy! I have a script that runs off a CD and copies a bunch of files to a computer. However, in order to copy the files I need to know the complete file path, including the drive letter. How can I determine the drive letter for the drive my script is currently running on?-- RKG(image) (image) (image) Hey, RKG. You ...

How Can I Delete a Backup File Created on the Previous Day?

(image) Hey, Scripting Guy! Each day we have a program that creates a file with a name similar to this: backup_20050607.bak. How can I delete the previous day’s file?-- JC(image) (image) (image) Hey, JC. Hmmm, a script that goes out and automatically deletes whatever happened the day before. Boy, could we have used a script like that a ...

How Can I Read a Text File on a Remote Computer?

(image) Hey, Scripting Guy! How can I read a text file on a remote computer?-- BM(image) (image) (image) Hey, BM. We have a confession to make: we’re using you and your question for our own nefarious purposes. Earlier this week we answered a question about reading the last line in a group of text files; in our answer we promised we’d ...

How Can I Unhide All the Files in a Folder?

(image) Hey, Scripting Guy! How can I run a script to unhide all the files in a folder?-- GA(image) (image) (image) Hey, GA. You know, when one of the Scripting Guys was a bit younger he and the other kids in his neighborhood spent countless hours playing variations on hide-and-seek; in fact, this Scripting Guy still has vivid memories of ...

How Can I Search for Two Items in a Text File?

(image) Hey, Scripting Guy! You’ve shown us how to search a text file for a single word or phrase, but how can I search a text file for two phrases? I need to know if a file contains either Windows 2000 or Windows XP.-- JR(image) (image) (image) Hey, JR. You know, it’s hard enough to get the Scripting Guys to do one thing; getting them...