By David Rosenthal.
Photoshop CS2 has a very handy tool that many don't know about. It's the Image Processor, and it can be found in File>Scripts>Image Processor.
As you can see, it offers you several options, and nothing's easier for converting image types, resolutions, colorspaces, or running actions.
In this case I am batch changing the JPEG quality to 5 and resizing to 400x267.