Pipe "y" into net stop on windows
25,607
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
Related videos on Youtube
Author by
Tomáš Zato - Reinstate Monica
It might be easier to hire new management than to get a new community of volunteers. - James jenkins If you play League of Legends, check my repository: http://darker.github.io/auto-client/ I no longer play and I am actively looking for someone to maintain the project. It helped thousands of people, literally.
Updated on September 18, 2022Comments
-
Tomáš Zato - Reinstate Monica over 1 year
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.
-
DukeSilversJazz over 6 yearsWhat about trying: net stop WAS /y
-
-
imtheman over 6 yearsAh thanks! I didn't see that. I updated my answer.
-
Tomáš Zato - Reinstate Monica over 6 yearsThanks. But do you have any idea why pipe did not work?