We study the transition between the strong and weak disorder regimes in the scaling properties of the average optimal path $ell_{rm opt}$ in a disordered ErdH{o}s-Renyi (ER) random network and scale-free (SF) network. Each link $i$ is associated with a weight $tau_iequivexp(a r_i)$, where $r_i$ is a random number taken from a uniform distribution between 0 and 1 and the parameter $a$ controls the strength of the disorder. We find that for any finite $a$, there is a crossover network size $N^*(a)$ at which the transition occurs. For $N ll N^*(a)$ the scaling behavior of $ell_{rm opt}$ is in the strong disorder regime, with $ell_{rm opt} sim N^{1/3}$ for ER networks and for SF networks with $lambda ge 4$, and $ell_{rm opt} sim N^{(lambda-3)/(lambda-1)}$ for SF networks with $3 < lambda < 4$. For $N gg N^*(a)$ the scaling behavior is in the weak disorder regime, with $ell_{rm opt}simln N$ for ER networks and SF networks with $lambda > 3$. In order to study the transition we propose a measure which indicates how close or far the disordered network is from the limit of strong disorder. We propose a scaling ansatz for this measure and demonstrate its validity. We proceed to derive the scaling relation between $N^*(a)$ and $a$. We find that $N^*(a)sim a^3$ for ER networks and for SF networks with $lambdage 4$, and $N^*(a)sim a^{(lambda-1)/(lambda-3)}$ for SF networks with $3 < lambda < 4$.