The File>Scripts>Script>Events Manager in photoshop cs5 should be able to do that.
Something like this:
I used File>Automate>Batch to open the files so any warning dialogs don't appear.
(depends on your color settings whether you would get any dialogs when opening the images)
I also recorded a dummy action to use with the batch command. Fit to Screen using insert menu item.
The action using batch and the batch dialog:
The Script Events Manager dialog: