Skip to content

Instantly share code, notes, and snippets.

@asaskevich
Last active May 5, 2017 14:56
Show Gist options
  • Save asaskevich/9468158 to your computer and use it in GitHub Desktop.
Save asaskevich/9468158 to your computer and use it in GitHub Desktop.
Compile and run C# app from command line
@echo off
:: Making directory for executable files
md build
set /p fName=Write source name:
:: Csharp compiler must be in %PATH%
csc.exe %fName%.cs
:: Move executable file to directory
move %fName%.exe build/
cd build
cls
:: Run compiled file
echo Starting %fName%.exe ...
echo.
echo.
echo.
call %fName%.exe
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment