We investigate the type of dual superconductivity responsible for quark confinement. For this purpose, we first obtain the static vortex solution of U(N) gauge-scalar models, which reduces to the Abrikosov-Nielsen-Olesen vortex in the U(1) case, by numerically solving the field equations of the gauge-scalar models in the whole range of space without restricting to the long-distance region. Then we use the resulting magnetic field of the vortex to fit the gauge-invariant chromoelectric field connecting a pair of quark and antiquark which was obtained by our numerical simulations for SU(2) and SU(3) Yang-Mills theories on a lattice. This result improves the accuracy of the fitted value for the Ginzburg-Landau parameter to reconfirm the type I dual superconductivity for quark confinement. Moreover, we calculate the Maxwell stress tensor to obtain the distribution of the force around the flux tube. This suggests the attractive force acting perpendicular to the chromoelectric flux tube, in agreement with the type I dual superconductivity.