如何卸载Windows服务,并删除其文件,而无需重新启动 [英] How to uninstall a windows service and delete its files without rebooting
问题描述
- 停止服务
- 卸载服务
- 重新启动系统(以便Windows释放文件)
- 部署新的.exe >
- 重新安装服务
- 开始升级的服务
我想避免重新启动,以便这可以完全脚本/自动升级。
有什么办法可以避免重新启动?也许一个命令行工具,将强制Windows放弃它的死亡之握,对旧的.exe?解决方案
sc删除服务名称
会删除一项服务。我发现 sc实用程序比查找要容易得多installutil。请记住,如果您还没有停止服务。
My current project involves deploying an upgraded .exe file that runs as a Windows Service. In order to overwrite the existing .exe with the new version, I currently need to:
- Stop the service
- Uninstall the service
- Reboot the system (so Windows releases it's hold on the file)
- Deploy the new .exe
- Reinstall the service
- Start the upgraded service.
I'd like to avoid the reboot, so that this can be a fully scripted/automated upgrade.
Is there any way to avoid rebooting? Maybe a command-line tool that will force Windows to give up it's death grip on the old .exe?
sc delete "service name"
will delete a service. I find that the sc utility is much easier to locate than digging around for installutil. Remember to stop the service if you have not already.
这篇关于如何卸载Windows服务,并删除其文件,而无需重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!