Scripting Blog [archived]

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

How Can I Use Windows PowerShell to Report Back the Name and Creation Date for Files Containing a Specified String Value?

(image) Hey, Scripting Guy! Using Windows PowerShell, how can I search for a string value in all the files in a folder full of text files, then report back the file name and creation date for each file where that string value was found? Oh, and I’d like to have these files sorted by date, too.-- JS(image) (image) (image) Hey, JS. You ...

Hey, Scripting Guy! How Can I Copy a Portion of a Microsoft Word Document to a New Microsoft Word Document?

(image) Hey, Scripting Guy! How can I find some text in a Microsoft Word document, copy the rest of the document from that point on, then paste the copied text into a brand-new Word file?-- CB(image) (image) (image) Hey, CB. You know, it’s kind of a melancholic day here at Scripting Guys world headquarters. That’s because the Juanita ...

Hey, Scripting Guy! How Can I Modify a .CSV File and Then Import That File into Microsoft Excel?

(image) Hey, Scripting Guy! I have a comma-separated values file that I need to import into Excel. However, before I do that I need to do some arithmetic and then add an additional field to the CSV file. On top of that, when I import this file I need to format this new field as a date-time value. How can I do that?-- R(image) (image) (image...

Hey, Scripting Guy! How Can I Search for a Word in a Text File and Return the Entire Line Where That Word Was Found?

(image) Hey, Scripting Guy! I have a scenario in which I need to read a list of names from a text file. I then need to search for each of those names in a second text file; if a name is found I need to extract the entire line in which that name appears. I’ve figured out how to search for a name in a text file, but I can’t figure out how ...

Hey, Scripting Guy! How Can I Identify the 20 Most-Recently Modified Files in a Folder?

(image) Hey, Scripting Guy! I Using VBScript, how can I identify the 20 most-recently modified files in a folder?-- TW(image) (image) (image) Hey, TW. You know, the Scripting Guy who writes this column was just reading – thanks to the magic of Spam email – about a new voice mail service. With this service you don’t have to listen to ...