The first point of this research is to develop several representations for the weighted m-weak group inverse. Secondly, we consider the minimization problem \(\min \Vert W(AW)^{m+1}X-(WA)^mB\Vert _F\) , \(m\ge 1\) in the Frobenius norm, subject to constraint \(\mathcal{R}(X)\subseteq \mathcal{R}((AW)^k)\) , where the exponent k is defined as the maximum between indices of AW and WA. The solution is expressed in terms of weighted m-weak group inverse. Particular settings of obtained results recover several known results in the literature. A representation in the form of an appropriate outer inverse of WAW with given image and kernel is obtained.