3

i want to run this code to rebuild my project every X minutes

devenv /rebuild Debug "C:\inetpub\wwwroot\myProject\Project.sln"

Now i can run this command only in Developer Command Prompt for VS2012, my question is, can i create .bat file to run this through Developer command prompt, if yes, what is the code lines that i need to write in .bat file?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Valoda
  • 335
  • 1
  • 5
  • 21

1 Answers1

2

There is a batch file called: vsVars32.bat.

Call that from your .bat file and it will setup the environment.

(Note there are other 'flavors' of the file, I think that is the correct one).

Steve Wellens
  • 20,506
  • 2
  • 28
  • 69
  • Ok, i'm calling it with "START "" "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat"" and then what? how can i give it my command line to rebuild the project? – Valoda Apr 15 '14 at 20:18
  • Put: Call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat" as the first line in your batch file. – Steve Wellens Apr 15 '14 at 20:21
  • And then in the same line i add the command? like this : Call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat" devenv /rebuild Debug C:\inetpub\wwwroot\myProject\myProject.sln – Valoda Apr 16 '14 at 06:44
  • I believe that is correct. Note: When I've setup batch files to do builds, all the settings are in the solution and project files. I've only used the supplied batch file when doing C++ builds...years ago. BTW, there is another file called VsDevCmd.bat discussed here: http://stackoverflow.com/questions/13774375/difference-between-vsdevcmd-bat-vcvarsall-bat-in-vs2012 – Steve Wellens Apr 16 '14 at 12:41