0

I need to build a c++ program in Visual Studio on Windows every 24 hours (I belive this is called a kron job?), and then send an email if it fails. I can't download any software on this machine, so I think I will have to make do with what Windows XP and visual studio has to offer.

I found a VBScript online that sends an e mail, which works fine. Now I need to automate the build.

I though about writing the thing on vbs and setting it in schedueled tasks to run once a day. I don't have any experience with VBs.

Is this a good way of solvig this? Any better ides?

Thanks!

Q-bertsuit
  • 3,223
  • 6
  • 30
  • 55
  • The obvious answer would be to use a build server for such tasks :-) – sloth Oct 02 '12 at 11:55
  • Otherwise, invoking [`MSBuild`](http://msdn.microsoft.com/en-us/library/dd393574.aspx) from a VBScript script shouldn't be [that hard](http://stackoverflow.com/questions/5690134/running-command-line-silently-with-vbscript-and-getting-output), either... – sloth Oct 02 '12 at 11:59
  • 1
    You could use the windows task schedular to .. Well.. Schedule the program to run – Abhinav Gujjar Oct 02 '12 at 12:05
  • Are you using revision control? – David Heffernan Oct 02 '12 at 12:17

1 Answers1

0

You can use devenv.exe to build a solution or a project.
devenv.exe has several command line switches that could be used to start a build.

For example, to build a Release configuration of a solution file called myworkspace.sln you would do the following - devenv.exe myworkspace.sln /build Release.

Here is the list of command line arguments supported by devenv.exe -
http://msdn.microsoft.com/en-us/library/xee0c8y7(v=vs.80).aspx

For the recurring task to be run every 24 hours, use the Windows Task Scheduler to create a recurring task which runs the devenv.exe command line shown above.

Task scheduler can be found in the Administrative Tools menu or you can run the command taskschd.msc.

Superman
  • 3,027
  • 1
  • 15
  • 10