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 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-...

How Can I Get a Script to Delete Itself?

(image) Hey, Scripting Guy! I have a script for installing a printer that I give to my end users. When the script finishes, I’d like it to be able to delete itself. How can I get a script to delete itself?-- EA(image) (image) (image) Hey, EA. You know, that’s an interesting idea: disposable scripts, just like disposable razors or ...

How Can I Hide the Command Window When Executing a Command Like net Localgroup Administrators?

(image) Hey, Scripting Guy! How can I hide the command window when executing a command like net localgroup Administrators?-- AA(image) (image) (image) Hey, AA. You know, before we begin we’d like to take a few minutes to recognize all those faithful readers who read the Hey, Scripting Guy! column each and every day. Hey, June; how’s it...

How Can I Use the RunAs Command to Run a Script Under Alternate User Credentials?

(image) Hey, Scripting Guy! How can I use the RunAs command to run a script under alternate user credentials?-- BE(image) (image) (image) Hey, BE. You know, in the business world one of the hot topics these days is synergy. For example, after The Mighty Ducks became a hit movie the Disney Company went out and bought themselves an NHL ...