I'm looking for a way to check the returncode / errorlevel of the SC command in a DOS script. How can I get this information ?
In most cases you can just check the value of %errorlevel%.
However, your comment seems to be correct that the %errorlevel% is useless for sc in particular. I'll keep the links included below for people who still want to read about %errorlevel% and application exit codes, but it appears I have not answered your question.
This is an explanation of exactly what errorlevel is - http://blogs.msdn.com/oldnewthing/archive/2008/09/26/8965755.aspx
I suspect you are mostly after the information whether the command succeeded or not. In that case you can simply use
which will execute the
Checking the pseudo-variable