Scripting Blog [archived]

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

How Can I Modify a Text File and Then Extract Selected Lines From the Modified Contents?

(image) Hey, Scripting Guy! How can I write a script that modifies the contents of a text file and then copies specified lines from the modified contents to a new file?-- EH(image) (image) (image) Hey, EH. There’s no way to do that. Now go away and leave us alone. Wait, sorry; we didn’t mean it. As it turns out, the Scripting Guy who ...

How Can I Change the First Two Octets of an IP Address?

(image) Hey, Scripting Guy! How can I change the first 16 bits on an IP address? I want to keep the last 16 bits exactly the same.-- LD(image) (image) (image) Hey, LD. Before we answer your question we should note that we are well aware that “suggestive” photos of an American Idol contestant have allegedly been uncovered on the ...

How Can I Get the Uptime of a Service?

(image) Hey, Scripting Guy! How can I get the uptime of a service?-- JC(image) (image) (image) Hey, JC. You know, if you could have seen the Scripting Guy who writes this column this morning you would have reconsidered asking him a question about uptime. Although he woke up in plenty of time, even turning off the alarm before it was due to...