Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Other Scripting Languages (http://www.programmingforums.org/forum39.html)
-   -   [Batch] Setting up Visual Studio build script (http://www.programmingforums.org/showthread.php?t=15505)

Klarre Mar 28th, 2008 1:54 PM

[Batch] Setting up Visual Studio build script
 
I am writing a script that will compile libraries using the Visual Studio compiler. But I am stuck with setting the Visual Studio environment variables. To do this I have to run the "c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" file. If I start a command line client and runs the file it works fine, and I can run the compiler (cl.exe) without being in its directory. But If I do the same thing through by batch file, the command line client simply exits after the execution of the "vcvars32.bat file". Why? Tha batch file looks like this, so far...
:

"%VS90COMNTOOLS%vsvars32.bat"
pause

The "pause" line is never reached.

Thanks for your help!

/Klarre

Ooble Mar 28th, 2008 2:23 PM

Re: [Batch] Setting up Visual Studio build script
 
You misspelt "vcvars32.bat" in the batch file. Not sure if this is your problem, but it can't hurt to fix it.

Klarre Mar 28th, 2008 2:39 PM

Re: [Batch] Setting up Visual Studio build script
 
No, I spelled it correctly. But I wrote the wrong file in my description. It should be "c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" .

Thanks! :)

The Dark Mar 28th, 2008 6:13 PM

Re: [Batch] Setting up Visual Studio build script
 
You have to use the "call" command, otherwise the other batch file runs instead of your own (think goto, rather than function call).
:

call "%VS90COMNTOOLS%vcvars32.bat"

Klarre Mar 28th, 2008 8:03 PM

Re: [Batch] Setting up Visual Studio build script
 
Ah, that solved the problem! Thanks a lot! :)

/Klarre


All times are GMT -5. The time now is 1:16 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC