We study the optimal control of a rate-independent system that is driven by a convex, quadratic energy. Since the associated solution mapping is non-smooth, the analysis of such control problems is challenging. In order to derive optimality conditions, we study the regularization of the problem via a smoothing of the dissipation potential and via the addition of some viscosity. The resulting regularized optimal control problem is analyzed. By driving the regularization parameter to zero, we obtain a necessary optimality condition for the original, non-smooth problem.