Unless m = n = 2, your dealing with an under-determined system aren't you ?

The first equation diag(AW) = b gets you n linear equations and the second, diag(WA) = c, m linear equations in the elements of W.

That means m + n equations for the mn unknown elements of W.

If that's the case ? there will be mn - m - n free variables.

Decide where, in W, you want these to be and solve for the others in terms of them.