Ze photoshoppen, ja?
What I would do is first go into Bridge, sort by dimensions, seperate the portrait and landscape oriented pictures into two different folders. Actually, first I would make copies of the images I'm altering, keep the originals in their original place. You'll need to make two action, one for the portraits, one for the landscapes.
landscape action:
(you need to have something open, even if it's a blank canvas, doesn't matter)
(start a new action)
IF images are in 3:2 ratio to begin with: canvas size > change to percent > set width to 93.33333333333333
IF images are in 4:3 to begin with: canvas size > change to percent > set height to 95.238095
(stop recording action, you're done)
portrait action:
same as above but for 3:2 apply the change to height, for 4:3 apply the change to width
Now, file > automate > batch. Select the appropriate action and folder. Assuming you're not working with the originals at this point just select "save and close" in the destination. Run it, when it's done do the other orientation, then you're done.