在 Windows 上用管道符“y”插入 net stop

在 Windows 上用管道符“y”插入 net stop

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

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.

我想在批处理作业中完成此操作。

答案1

有一个未记录的net与命令一起使用的参数,/y或者/yes绕过提示。因此,对于您的情况,它将是:

net stop WAS /y

相关内容