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.
是否可以在 Visual Studio 2008 C++ 项目中为“自定义构建步骤”命令设置工作目录?
我不知道您是否可以设置默认工作目录,但您可以在自定义构建步骤中自行更改。
在具有自定义构建步骤的文件的“属性页”对话框中,选择“命令行”字段并单击...按钮:
...
在命令行对话框中,您可以添加多个命令,所有这些命令都将为自定义构建执行。要将工作目录更改为C:\MyFolder并启动位于该文件夹中的MyProgram.exe ,请添加以下行:
另一种方法是在 bat 文件中定义所有这些,例如MyCustomBuild.bat并在命令行字段中调用它:call MyCustomBuild.bat
call MyCustomBuild.bat