Archive: Bad Net Start Return Code?


Bad Net Start Return Code?
nsExec::Exec /TIMEOUT=700 "NET START sdfweflwiejflsdkfjsliefj" SH_HIDE
pop $0
MessageBox MB_OK "Trying to start :sdfweflwiejflsdkfjsliefj RESULT:$0"


Returning 2.. no matter what the test is a valid service or not..... Clearly this is not right. Any ideas?


This exists in my code...

${Switch} $0
${Case} "0"
DetailPrint " Service was started."
Goto EndServiceTest
${Case} "1"
DetailPrint " Service was not supported."
Goto EndServiceTest
${Case} "2"
DetailPrint " Service is running."
Goto EndServiceTest
${Case} "8"
DetailPrint " Unknown failure starting Service."
Goto EndServiceTest
${Case} "10"
DetailPrint " Installer has verified that Service is running."
Goto EndServiceTest
${EndSwitch}
EndServiceTest:

; These are the NET START return codes.
; gs_service_status( 0) = "Success"
; gs_service_status( 1) = "Not Supported"
; gs_service_status( 2) = "Access Denied"
; gs_service_status( 3) = "Dependent Services Running"
; gs_service_status( 4) = "Invalid Service Control"
; gs_service_status( 5) = "Service Cannot Accept Control"
; gs_service_status( 6) = "Service Not Active"
; gs_service_status( 7) = "Service Request Timeout"
; gs_service_status( 8) = "Unknown Failure"
; gs_service_status( 9) = "Path Not Found"
; gs_service_status(10) = "Service Already Running"
; gs_service_status(11) = "Service Database Locked"
; gs_service_status(12) = "Service Dependency Deleted"
; gs_service_status(13) = "Service Dependency Failure"
; gs_service_status(14) = "Service Disabled"
; gs_service_status(15) = "Service Logon Failure"
; gs_service_status(16) = "Service Marked For Deletion"
; gs_service_status(17) = "Service No Thread"
; gs_service_status(18) = "Status Circular Dependency"
; gs_service_status(19) = "Status Duplicate Name"
; gs_service_status(20) = "Status Invalid Name"
; gs_service_status(21) = "Status Invalid Parameter"
; gs_service_status(22) = "Status Invalid Service Account"
; gs_service_status(23) = "Status Service Exists"
; gs_service_status(24) = "Service Already Paused"


What's SH_HIDE doing there? nsExec doesn't parse that parameter. Shouldn't cause it to always return 2, but something else might and you should therefore include the offending code itself and not a paraphrase of it.