1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 10 - Using Modules and Procedures - Part 2

By Dan Mabbutt, About.com

4 of 7

Building and Running a Console Application Continued

Console Application

Console Application

2 - Open a DOS (Command Prompt) window and navigate using CD commands to the folder where you saved your program file.

  • Enter this command at the DOS command line:

    ~~~~~~~~~~~~~~~~~~~~~~~~~
    PATH %PATH%;C:\WINNT\Microsoft.NET\Framework\v1.1.4322
    ~~~~~~~~~~~~~~~~~~~~~~~~~


    This allows your computer to find the VB.NET compiler program, VBC.EXE. If you have a different Operating System or a different version of .NET, you might have to make minor adjustments. To verify the right PATH for your computer, Search for VBC.EXE and use whatever PATH it's in.

    3 - Compile your program! Use this command:

    ~~~~~~~~~~~~~~~~~~~~~~~~~
    VBC /r:Microsoft.VisualBasic.dll testconsole.vb
    ~~~~~~~~~~~~~~~~~~~~~~~~~


    4 - Run your program! Just enter the name.

    The illustration at the top shows what the process looks like.

    There's a tendency for people to dismiss Console apps because "they're just DOS" - Don't Make That Mistake! The command prompt is a powerful environment that will outlive all of us. To prove it, here's a series of articles I wrote that makes heavy use of the native VBC compiler. (This is another article that might be a bit advanced if you're just starting.)

  • Explore Visual Basic
    By Category
    About.com Special Features

    Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

    Easy ways to connect two computers for networking purposes. More >

    1. Home
    2. Computing & Technology
    3. Visual Basic
    4. Learn VB.NET
    5. Using Modules and Procedures - Part 2

    ©2009 About.com, a part of The New York Times Company.

    All rights reserved.