Command Line Switches

Description

Determines whether Visual Basic compiles and runs a program, compiles and makes an executable (.EXE) file, or sets the argument part of the command line returned by the Command function.

Syntax

vb[.exe] [[{ /run | /r} makname ] [{ /make | /m } makname ] { /cmd argument | /c argument }]

Remarks

The parts of the command line switches syntax are:

Part                 Description

makname         The name of your project (.MAK) file.

/run or /r          Tells Visual Basic to compile makname and run it, using the argument stored in the Command Line Argument option in the Project command of the Options menu.

/make or /m      Tells Visual Basic to compile makname and make an executable (.EXE) file from it, using the existing settings of the Path, EXEName, and Title properties of the App object.

/cmd or /c        Puts argument in the Command Line Argument option in the Project command of the Options menu.  When used, this must be the last switch on the command line.

argument          Any string expression used by your program.  You can retrieve this string with the Command function.

When used, these switches must be in a command line to run Visual Basic.  For example, you might use them in the Properties dialog of the Windows Program Manager.  Here is a valid command line that runs Visual Basic, loads a specific project, and runs it:

C:\vb.exe /r MYPROJ.MAK