暂停批处理文件,直到停止服务完成? [英] Halt batch file until service stop is complete?

查看:241
本文介绍了暂停批处理文件,直到停止服务完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用一个批处理文件,停止Windows服务。我使用了 SC 命令,但我开到其他的想法,考虑以下问题。问题是,该批处理文件进行的同时的服务被停止的(即停止参数 SC 似乎只的要求的停止 - 它不会的的为止损)

I'm using a batch file to stop a Windows service. I'm using the sc command, but I'm open to other ideas, given the question below. The problem is that the batch file proceeds while the service is stopping (the stop argument to sc seems only to request the stop -- it doesn't wait for the stop).

如何修改该批处理文件的无法继续的,直到站的完整的?

How can I modify the batch file to not proceed until the stop is complete?

推荐答案

使用可以使用净停止,这是同步的,也就是说,它会等到服务停止。

Use can use NET stop, which is synchronous, i.e it will wait until the service stops.

请参阅
  - <一个href=\"http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_subcmds.mspx?mfr=true\">NET停止

这篇关于暂停批处理文件,直到停止服务完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆