Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Clear the Contents of Any File Dropped on My Script Icon?

Hey, Scripting Guy! How can I write a script that will clear the contents of any file that I drag and drop on the script icon?-- SN Hey, SN. Say, you didn’t by any chance misplace a few hundred thousand insects did you? OK; just thought we’d ask. This past weekend the Scripting Guy who writes this column had to drive across the state to...

How Can I Create a Table in a SQL Server Database?

Hey, Scripting Guy! How can I create a table in a SQL Server database?-- FD Hey, FD. And thanks: you’ve saved the Scripting Guys! Or, at any rate, you’ve saved the Scripting Guy who writes this column. As it turns out, this Scripting Guy is getting ready to leave town and attend his nephew’s wedding. Before he can leave, however, he ...

How Can I Change an Existing Hyperlink in a Microsoft Word Document?

Hey, Scripting Guy! How can I change an existing hyperlink in a Microsoft Word document?-- PH Hey, PH. You know, we’re impressed that you had the guts to ask a question today; after all, today is Friday the 13th, a date many people dread, fearing that anything bad that could happen will happen. For example, people who suffer from ...

How Can I Make Sure That No Line in a Text File Exceeds 261 Characters?

Hey, Scripting Guy! How can I make sure that no row in a text file exceeds 261 characters?-- RK Hey, RK. You know, this was a good day to ask a question; for once the Scripting Guy who writes this column is in an OK mood. (No, he’s never in a good mood, at least not when he’s at work.) Yesterday the Scripting Son absolutely had to have ...

How Can I Delete a Record From a Disconnected Recordset?

Hey, Scripting Guy! How can I delete a record – or a set of records – from a disconnected recordset?-- SM eHy sm.,. Sorry; let’s try that again: Hey, SM. We apologize for the poor typing the first time around; the Scripting Guy who writes this column is trying to adjust to typing with just one hand and just one eye. Last night this ...