我们可以在 Visual Studio 的后期构建事件命令行中执行 .bat 文件吗? [英] Can we execute a .bat file in post build event command line in visual studio?

查看:31
本文介绍了我们可以在 Visual Studio 的后期构建事件命令行中执行 .bat 文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在 Visual Studio 的后期构建事件命令行中执行 .bat 文件吗?

Can we execute a .bat file in post build event command line in visual studio?

推荐答案

当然,这是一个例子:

call "$(SolutionDir)scriptscopyifnewer.bat" "$(SolutionDir)libsRLPL.Services.CertificateValidator.Basic.dll" "$(TargetDir)RLPL.Services.CertificateValidator.Basic.dll"
call "$(SolutionDir)scriptscopyifnewer.bat" "$(SolutionDir)libsRLPL.Services.CertificateValidator.Common.dll" "$(TargetDir)RLPL.Services.CertificateValidator.Common.dll"

请注意您可能遇到的两个问题:

Just be aware of two possible issues you might have:

  1. 封闭的双引号(看看每个部分是如何被"符号包围的)

如果您想调用 2 个或更多批处理文件,请确保使用 call 命令,否则您将无法找到第二个 bat 不工作的原因

if you want to call 2 or more batch files make sure you use call command otherwise you'll have a trouble finding why the second bat is not doing its job

这篇关于我们可以在 Visual Studio 的后期构建事件命令行中执行 .bat 文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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