Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个相当大的 msbuild xml 脚本。我对 xml 不是很流利,有没有办法在脚本中启动或停止 Windows 服务而不将代码放入批处理文件中?
谢谢
您可以使用以下命令启动/停止服务
net start "servicename"
或者
net stop "servicename"
或在 MSBuild 中:
<Exec Command="net start %(Service.Name)" />