This paper studies a stochastic control problem with regime switching in a fairly general abstract setting. Such problems may arise from production planning management. We perform a full mathematical analysis of this stochastic control problem via the HJB equation and verification. The connection of the optimal controls and subgame perfect controls is discussed, and it is shown that the optimal controls solve the generalized HJB equation as well. In a special case we provide a closed form solution.