Advertisement
Shedal

C# in .bat

Feb 7th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. /*
  2. @echo off && cls
  3. set WinDirNet=%WinDir%\Microsoft.NET\Framework
  4. IF EXIST "%WinDirNet%\v2.0.50727\csc.exe" set csc="%WinDirNet%\v2.0.50727\csc.exe"
  5. IF EXIST "%WinDirNet%\v3.5\csc.exe" set csc="%WinDirNet%\v3.5\csc.exe"
  6. IF EXIST "%WinDirNet%\v4.0.30319\csc.exe" set csc="%WinDirNet%\v4.0.30319\csc.exe"
  7. %csc% /nologo /out:"%~0.exe" %0
  8. "%~0.exe"
  9. del "%~0.exe"
  10. exit
  11. */
  12.  
  13. class HelloWorld
  14. {
  15.   static void Main()
  16.   {
  17.     System.Console.WriteLine("Hello, World!\r\nI am at " + System.Environment.Version);
  18.     System.Console.ReadLine();
  19.   }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement