If the drives all have the same geometry:
Get partition info:
dd if=/dev/hda of=mbr_part_table bs=512 count=1
Set partition info:
dd if=mbr_part_table of=/dev/hda bs=512 count=1
Should be quite scriptable if you put the resulting file from step
one close to the script ;}
Another alternative would be expect.
man expect for details - most distros provide it.