Adapted from "Scripting Made Simple" by Robert Green at www.cad-manager.com:

Script procedures are one of the oldest, lowest tech forms of AutoCAD customization. A script is simply a file that contains the exact series of keystrokes required to make AutoCAD perform a given task. The script file is authored using a plain text editor (such as Notepad) and saved with an SCR extension for reading by AutoCAD's SCRIPT command. Two key characteristics of AutoCAD scripts should be pointed out before we proceed:

Scripts may only invoke commands that can be typed into AutoCAD's Command: prompt. Therefore any task that requires dialog style commands is not a good candidate for scripting. Note that some commands may be easier to use with a dialog, but do not necessarily require dialog box. A good example of this is the Plot command.

Scripts allow AutoCAD to run unattended thus permitting great productivity for repetitive operations like purging or plotting batches of drawings. They key strength is that scripts can open, save and quit drawings thus hopping between drawing sessions with ease.

Here is an example of a simple script this will draw a sqaure and them zoom out to the extents of the drawing:

line
0,0
5,0
5,5
0,5
close
zoom
e