Celeb Glow
general | March 05, 2026

Pipe "y" into net stop on windows

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

1 Answer

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy