If you want to change an images Aspect ratio you need to crop your image if you doe not want to introduce distortion. If you do not want to crop you can use automate Fit Image the fit you images to fit within some pixel size area. Your images will be resized to fit within the pixel area you set into the fit image dialog. If yout Image have a different Aspect Ratio than that area the resized images will not fill the area it will retain its aspect ratio. You can Add canvas to those resized images so they will be the fit Image size you set. There will be borders on images that do not have Fit image area aspect ratio.
That would be a simple script that add canvas to the document so its canvas is square. Save ruler units, Set ruler units to pixels if the document width is larger that the document height set canvas size to width by width else set canvas size height by height leave the anchor point the default center one, restore users ruler units. No resizing is needed. You can set the Print resolution for what ever size you want to print the image. Print ]DPI Resolution = Width Pixels/Print Size
You could record the script in an action and batch the action with menu file>Scripts>Image Processor.