Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My application calls a Stored Procedure, through the stored procedure I am calling a Windows Service using the NET START command as follows:

SELECT @Cmd = 'Net Start ServiceName /"' + @param1 + '" /"' + @param2 + '"' 

Now the parameters passed here are not reaching the OnStart method. These values are blank.

Protected Overrides Sub OnStart(ByVal args() As String)
service1= New Service
service1.param2 = args(1)
service1.param1 = args(0) 

Here I get args(0) as the name of service instead of the value that is passed, and args(1) is blank. Although the args.Getlength(0) returns 2.

The service starts successfully, it invokes the executable, but the parameters are not there.

What can be the reason?

  • Administrative access might be required in NET START command?
  • Has the syntax changed for NET START command in Windows Server 2008?
  • Windows Services do not accept parameters in Windows Server 2008?

The same thing is running fine on Windows Server 2003.

share|improve this question

NET START doesn't support passing parameters. EDIT: Actually it apparently does pass parameters in some cases as you have stated. I suspect that this behaviour of the NET START command was by accident rather than by design, which is why it no longer works and why the behaviour isn't mentioned here

Try sc start instead, as per this answer here

sc start also officially supports passing parameters.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.