批处理文件启动和停止服务

来源:互联网 发布:小学生画画软件下载 编辑:程序博客网 时间:2024/04/29 07:05

文章背景: 很多应用都需要服务来支持才能正常使用,比如oracle、vmware等。但这些服务在安装好程序之后是默认启动的,一般我们不用的话,就会占用系统资源,我们可以设置为开不自动启动,而用批处理文件在需要使用的时候才启动起来,不用的时候用批处理文件停止。如何使用批处理文件?


在我的电脑上,右键--》管理--》选择服务和应用程序--》


找到对应的服务的服务名称:一般的服务都是以应用程序头的,如oracle以O开头,按O键可以搜索。。。



右键,属性可调整启动类型,一般禁用。copy显示服务名称


新建一个bat文件,内容如下:

net start "VMware Authorization Service"

net start "VMware DHCP Service"
net start "VMware NAT Service"
net start "VMware Registration Service"

net start "VMware Virtual Mount Manager Extended"



停止脚本如下:

net stop "VMware Authorization Service"

net stop "VMware DHCP Service"
net stop "VMware NAT Service"
net stop "VMware Registration Service"

net stop "VMware Virtual Mount Manager Extended"




原创粉丝点击