We adapt and apply a recently developed optimization scheme used to obtain effective potentials for aluminosilicate glasses to include the network former boron into the interaction parameter set. As input data for the optimization, we used the radial distribution functions of the liquid at high temperature generated by ab initio molecular dynamics simulations, and density, coordination, and elastic modulus of glass at room temperature from experiments. The new interaction potentials are shown to reliably reproduce the structure, coordination, and mechanical properties over a wide range of compositions for binary alkali borates. Furthermore, the transferability of these new interaction parameters allows mixing to reliably reproduce the properties of various boroaluminate and borosilicate glasses.