Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Remove the First Five Lines From All the Log Files in a Folder?

Hey, Scripting Guy! I have about 400 log files in a folder. I need to go in and remove the first 5 lines from each of those log files. How can I write a script to do that?-- JW Hey, JW. Before we begin we need to issue a clarification. A few days ago we reported that the Scripting Guy who writes this column had thrown a basketball the ...

How Can I Assign a Background Color to Cells in a Spreadsheet and Then “Sum” Those Cells?

Hey, Scripting Guy! How can I assign a background color (based on a specified value) to a spreadsheet cell and then “sum” those cells?-- JC Hey, JC. Thanks for the question. And yes, you heard correctly: in his last game the Scripting Son did indeed go 4-for-4, banging out three singles and a double. That outing raised his batting ...

How Can I Start a Process and Then Log the User Off When That Process Ends?

Hey, Scripting Guy! How can I write a script that starts a process, waits until that process ends, and then logs the user off the computer?-- AG Hey, AG. You know, the Scripting Guy who writes this column is never one to brag, mainly because he never has much of anything to brag about. In addition tot that, however, he is a humble and ...

How Can I Sort a Row in an Excel Spreadsheet?

Hey, Scripting Guy! How can I sort a row in an Excel spreadsheet?-- RF Hey, RF. You know, this is a tough question, but as a resident of the state of Washington the Scripting Guy who writes this column doesn’t shy away from a challenge. Therefore, he fully intends to address this matter … in the year 2013. In case you’re wondering ...

How Can I Get the Command Window to Stay Open When I Right-Click a Script and Choose Open With Command Prompt?

Hey, Scripting Guy! How can I get the command window to stay open when I right-click a .VBS file and choose Open With Command Prompt??-- BB Hey, BB. You know, according to BB’s email signature, he’s 9 years old. If that’s true, well, that’s absolutely amazing. A 9-year-old who knows VBScript? At age 9 the Scripting Guys could barely...

Feedback usabilla icon