Scripting Blog [archived]

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

Hey, Scripting Guy! Awww—Windows PowerShell Plays Nice-Nice with VBScript and Batch!

  (image) Hey, Scripting Guy! I would like to be able to integrate VBScript scripts into my Windows PowerShell code. I also have some batch files I wish I could use with Windows PowerShell. I do not want to have to rewrite code that works perfectly fine. Is this possible? -- SK   (image) Hello SK, Microsoft Scripting Guy Ed Wilson ...

Hey, Scripting Guy! How can I Migrate a VBScript to Windows PowerShell that parses a log file for errors?

  (image)   Q: Hey Scripting Guy! I need to migrate a VBScript to Windows PowerShell 2.0 that I use to parse a log file for errors that occur during a specific operation. I am only interested in the errors, not the success statements. Because this log has a tendency to grow rather large, I would like to write the failure ...

Hey, Scripting Guy! How can I Convert a VBScript That Searches Text Files into Windows PowerShell?

  (image)   Q: Hey Scripting Guy! I need to convert a VBScript into Windows PowerShell 2.0. The script reads the first line of all text files that are in a particular folder, and if a specific word is in that file, it moves the text file to an archive folder. -- AO A: Hello AO, Microsoft Scripting Guy Ed Wilson here, I have ...

Hey, Scripting Guy! How can I use Windows PowerShell to Search a Text File for multiple strings?

  (image)   Q: Hey Scripting Guy! I need help migrating a script from VBScript to Windows PowerShell 2.0. The VBScript is one that I based upon an old Hey Scripting Guy! article. I use it to search a text file for specific words. If the words are found, the script displays a message stating this fact. I do not want to learn ...

Hey, Scripting Guy! How Can I Use Windows PowerShell to Create a Text File with Fixed-Length Lines?

  (image)   (image) Hey, Scripting Guy! I am trying to learn Windows PowerShell 2.0, but I am having some issues when it comes to string manipulation. I have been a faithful reader of the Scripting Guys for several years, and I have found many of the scripts to be critical in my business environment. I wish I could simply ...