15

I want to stop a service without being prompted. This is what I tried:

C:\>echo y|net stop WAS
The following services are dependent on the Windows Process Activation Service service.
Stopping the Windows Process Activation Service service will also stop these services.

   World Wide Web Publishing Service

Do you want to continue this operation? (Y/N) [N]:
No valid response was provided.

I want to do this within batch job.

1
  • What about trying: net stop WAS /y Commented Oct 31, 2017 at 20:25

1 Answer 1

25

There is a undocumented parameter that works with net commands, /y or /yes which bypasses the prompt. So in your case it would be:

net stop WAS /y
2
  • 1
    Ah thanks! I didn't see that. I updated my answer.
    – imtheman
    Commented Oct 31, 2017 at 20:35
  • 2
    Thanks. But do you have any idea why pipe did not work? Commented Oct 31, 2017 at 21:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .