Scripting Blog [archived]

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

How Can I Modify the Output of the Ping Command?

(image) Hey, Scripting Guy! How can I place the current date and time at the beginning of each line of Ping.exe output?-- AL(image) (image) (image) Hey, AL. We have to admit, we were a little shocked by your question. Change the output of the Ping command? Really, AL. Would you ask us to rewrite Romeo and Juliet, giving it a more happy and...

How Can I Remove Blank Spaces From File Names?

(image) Hey, Scripting Guy! I have a folder with a bunch of files in it, files with names like Doc 1.pdf, Doc 2.pdf, and Doc 3.pdf. How do I remove the blank spaces from all those file names?-- JRP(image) (image) (image) Hey, JRP. You know, today’s column represents a landmark in Hey, Scripting Guy! history. Why’s that? Because the ...

How Can I Remove Double Double Quotes From a Text File?

(image) Hey, Scripting Guy! I have a comma-separated values file that has data similar to this: data1",""data2"","data3",""data4"". As you can see, some of the items are enclosed by two sets of double quote marks (like ""data2""). How can I remove one of those sets of double quote marks, leaving the item looking like this: “data2”?-- RH(...

How Can I Determine the Name of a Script While That Script is Running?

(image) Hey, Scripting Guy! From within the script itself, how can I get the name of a running script? I need that in order to create a generic error handler for all my scripts.-- TB(image) (image) (image) Hey, TB. You know, the Scripting Guy who writes this column is in the office today, trying to wrap things up so he can start a well-...