Search code examples
.netvisual-studio-2010batch-fileenvironment-variablescsc

how to ensure that VSVARS32.BAT batch file have permanent effect?


If I need to use microsoft C# compiler from the normal command prompt, it says right here how and it says right here how I set the environment variable (by running VSVARS32.BAT). I execute it and after that I can run "csc" (the compiler). However the effect seems to disappear when I close the command line window that run VSVARS32.BAT

Is there a way to make the environment variables permanent, so that I can run csc.exe from an application?


Solution

  • I would suggest that you create a new .bat file that launches the vcvars.bat and then your application. This will make sure that the environment is setup appropriately.