0

I wrote the batch script below to compile cs code, but it does not work. Any ideas?

   @echo off
   %comspec% /k ""C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86
   csc.exe -target:exe *.cs

It opens the vcvarsall.bat but the last line does not work.

12
  • no error but nothing happens but opennig vs command prompt! Commented Sep 18, 2012 at 8:49
  • 3
    Uhm... shouldn't that be csc.exe instead? Commented Sep 18, 2012 at 8:51
  • Does that file exist? (I.e can you see in it Explorer, in that folder) Commented Sep 18, 2012 at 8:52
  • 1
    Take out the @echo off and try again - you'll see more output then. Commented Sep 18, 2012 at 8:52
  • @Christian.K: blimey, I didn't even spot that :-) Commented Sep 18, 2012 at 8:52

2 Answers 2

1

using /k will mean the %comspec% will remain in memory, until you exit the shell.
use /c and the batch file should continue after the other batch file has been run.

Also, you can use call in the place of %comspec% /c

Sign up to request clarification or add additional context in comments.

Comments

0

To Make it works :

1- add this path to the system environments:

   C:\Windows\Microsoft.NET\Framework\v4.0.30319

2- change the .bat file to this:

   @echo off
   csc.exe -target:exe *.cs

.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.