管道“y”到窗口上的网络停止

Tom*_*ica 8 windows batch command-line cmd.exe

我想在没有提示的情况下停止服务。这是我尝试过的:

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.
Run Code Online (Sandbox Code Playgroud)

我想在批处理作业中执行此操作。

imt*_*man 18

有一个未记录的参数可以与net命令一起使用,/y或者/yes绕过提示。所以在你的情况下,它将是:

net stop WAS /y
Run Code Online (Sandbox Code Playgroud)

  • 谢谢。但是你知道为什么管道不起作用吗? (2认同)