dos batch files idea



Could someone please tell me if this is possible.  Creating a dos batch 
file that opens and runs maxima is easy to do.  What I was wondering if 
I could create a dos batch file that opens maxima, has it execute a few 
commands and then closes maxima?  My thought is this:  It seems like it 
is quite difficult from the responses I've gathered to actually call 
maxima from java, or c or any other programming language.  But it is 
easy to have  that programming language create a dos batch file and run 
it.  If the batch file can give maxima a list of commands - one of which 
writes maxima outuput to a file to be read later by the program, problem 
solved.  Someone please let me know if this idea is plausible or not.  
Thanks.

JIm