I had two contexts set up, and when I tried this code, I got an error: sqlcmd stop mssql2 I would expect to be able to specify a context and stop it. Switching between them is a hassle. The error is shown here: 