The “Hey, Scripting Guys!” blog has been retired. There are many useful posts in this blog, so we keep the blog here for historical reference. However, some information might be very outdated and many of the links might not work anymore.
New PowerShell content is being posted to the PowerShell Community blog where members of the community can create posts by submitting content in the GitHub repository.
(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 ...
(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 ...
(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 ...
(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 ...
(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...