COMPILING & RUNNING Visual Studio .Net Projects
Please the follow step by step instructions below to prepare "compile.bat" and "run.bat" files for your VS .Net Projects or Solutions.
Step1) Open your notepad and name it "compile.bat" and save it in the directory where your project's solution file (.sln) file exists (it is generally the directory where you asked the editor to save the solution).
To be simple, just save the file in the directory where your solution file (.sln file) exists.
Step2) Write the following statement:
"C:\Program Files\Microsoft Visual Studio .Net\Common7\IDE\devenv" YourSolutionName.sln /build debug
Except "YourSolutionName.sln" everything can be copied.
In place of "YourSolutionName.sln" please write your own solution file name (followed by .sln).
Note: Please note that all the projects in the solution will be built. If you want to build specific projects in a solution use the /project switch followed by the project name.
Step3) Double click the file and see if it works :)-
(If the command line window just pops up and goes away in a flash, then you are doing some mistake. To see what is the mistake you can add any dummy statement that does not close the window, say, "copy con t")
Step4) Do step1 but name the file as "run.bat"
Step5)Just write the path of your executable. Normally it is 3 levels below your solution directory (project/bin/debug).
For example, for a project named "Requirements" it would be :
"Requirements\bun\debug\Requirements.exe"
Step6) Double click the file and see if it works :)-
EXAMPLE
Please download the project to see exactly how it is working and how is the directory structure
Reference: