Modelsim is like Matlab in that anything you type into the command window can be scripted by putting commands in a file (with an arbitrary name). This can be handy if you do things repetitively. I have created an example. Get the files and try it yourself.
Files
Explanation
- init
- deletes any simulation auxiliary files and recreates the work library
- c
- compiles the verilog files specified
- t
compiles your verilog, starts the simulation environment turning off optimizations, activates the waveform window, and runs the simulation for 100ns