Command-Line Arguments

Command-line arguments are provided as an array of String objects obtained via the Environment.GetCommandLineArgs method.[1] An integer exit code can be returned to the operating system via the Environment.ExitCode property to indicate the overall success or failure of the program upon termination. This is useful for controlling batch scripts or other programs that execute your VB.NET program. The Environment class provides access to other useful information, such as environment strings and the current directory. This example is provided in the AccessEnvironmentInfo directory.

[1] To establish command-line arguments within Visual Studio, right-click on the project node (not the solution node) in Solution Explorer, choose ...

Get Application Development Using Visual Basic® and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.