Here's a useful example: when encoding MP3s, I've found it's often faster to skip the user interface and use LAME directly. Download the LAME mp3 encoder someplace, and it will come with an executable. Then, you can write a batch file (.bat) like:
rem Adapted from a script by Robert Hegemann
@echo off
:processArgs
if %1=="" goto endmark
"C:\path\to\lame.exe" -h --abr 160 --mp3input %1
if errorlevel 1 goto errormark
shift
goto processArgs
:errormark
echo ERROR processing %1
pause
:endmark
pause