Monday, November 17, 2008

Script Headers

Okay, so you wrote a really cool batch script. Now what information do you put at the top?

After writing many, many batch scripts with really nothing but the filename and modified date as "information" I looked around a bit and put together this from what I saw.

rem **********************************
rem * Desktop System setup script
rem * Author: Thomas Thrush
rem *
rem * Last modified : 17-Nov-2006
rem **********************************

Now this is a pretty simple entry; other entries may include History, Notes, Revision Numbers, etc. Various scripting languages have there own way of commenting out text, but the information still applies.

The point is, put something there for future reference. When a script has to be modified many months down the road, the editor (which might be you) will be glad you did.

Update: It's been a while since this post and I've changed my header to reflect things I've learned...

:: ======================================
:: Script: NoPic.cmd
:: Desc: Find AD Accounts w/blank jpegPhoto Attr
:: Author: Tom Thrush - tom<at>tthrush<com>
:: Last modified: 22-Apr-2011
:: ======================================

One, the double colon runs faster as it's passed over by the scripting engine, where as rem is actually examined.

And two, with malware searching a system for addresses to spam or attack, it's best not to include a path to your door.

No comments:

Post a Comment