This is how I did it:

for /f "tokens=5 delims=" %A in ('reg query HKLM\SYSTEM\CurrentControlSet\Services') do sc qc %A

Let me know if you know of a better way.

If you don’t know why this could be important read here:

http://www.ihtb.org/security/program.exe-privilege_escalation.txt

If you are on a Win7 box or otherwise have the option to use WMI you can use the following command: wmic service get pathname