TransUniv

Friday, January 23, 2015

How to execute C# programs in cmd

                  If you want to compile and run C# programs via cmd (Command Prompt) instead of using Visual Studio C# Express IDE then follow the following simple steps .




1. Find Microsoft.NET installation path.


        You might know the Microsoft.Net is the framework to make windows based applications with various programming languages. This .Net path is installed in your systems windows directory.
Just copy this path. "C:\Windows\Microsoft.NET\Framework\v4.0.30319". The version number (v4.0.30319) may vary based on your .Net framework version.



2. Change your path in cmd.


        Open the command prompt and change the directory to where the c# source codes are saved. Check out following screenshot.



3. Set path to .Net Framework.


          Now set .Net framework's path to your working directory to compile and run the programs like shown in the screenshot below.



4. Compile and Run


       Now you are ready to compile and run your programs.


  • To compile the program use "csc File_name.cs" (Without Quotes) for example "csc helloworld.cs".
  • To run the program use "File_name" (Without Quotes) for example "helloworld".
     


  Hope it was useful to you.



Today's Quote:

                       "Be the change you want to see in the world".
  
                                                                                            - Mahatma Gandhi.



        

5 comments:

  1. Great information...Your post the very informative i have learned some information about your blog thank you for Sharing the great information.....
    Weblife Infotech

    ReplyDelete
  2. I have been looking for this kind of blog. and I explore various software testing services. but couldn't find like that. There is a firm Insbytech which also writing these kind of blogs and also giving free consultations to their clients.

    ReplyDelete
  3. Great tutorial! You've explained how to execute C programs via CMD in a clear and beginner-friendly way. It's always helpful to revisit the basics, especially for those just starting out in programming.

    On a different note, if you're a seller looking to grow your online presence, we offer Top Flipkart Product Listing Catalogue Services. From keyword-optimized product titles to detailed descriptions and category management, we help your products stand out and sell more on Flipkart. Let us handle the cataloging while you focus on your business growth!

    ReplyDelete