Thursday, November 18, 2010

sc.exe problem Wrong return code

sc.ece version 5.2.3790.4455 does not return error code 1060 when querying non existing service

C:\>sc.exe query NonExistingServiceName
[SC] EnumQueryServicesStatus:OpenService FAILED 1060:

The specified service does not exist as an installed service.


C:\>echo %ErrorLevel%
0



While on other macine the same commands give error
c:\>sc.exe query NonExistingServiceName
[SC] EnumQueryServicesStatus:OpenService FAILED 1060:

The specified service does not exist as an installed service.


c:\>echo %ErrorLevel%
1060

just a little annoying thing