Visual Basic Keyword Upgrade Tool

The Keyword Upgrade command-line tool makes Visual Basic .NET source files compatible with the current version of Visual Basic.

vb7to8[.exe] [arguments]

Arguments

The following arguments can appear in any order.

Argument

Meaning

filename

Causes the tool to process the filename file. Surround the file name with double quotation marks (" ") if the file name contains a space.

The tool can process multiple files.

/check

Reports which files need upgrading and leaves them unchanged.

If no upgrades are needed, the tool returns "No files in need of upgrading".

/codepage:number

Specifies the code page to use for all source-code files in the compilation. The tool uses the code page specified by number to interpret the encoding of the source files.

The /codepage option is not needed if the source-code files were saved using the current ANSI code page, Unicode, or UTF-8 with a signature.

/help or /?

Displays the tool options.

/nobackup

Prevents the tool from creating backup files; existing source files are still overwritten.

By default, when a file is modified, the content of the original file is copied into a new file. The new file name is derived by appending ".old" to the original file name.

/nologo

Suppresses display of the copyright banner.

/quiet

Prevents the tool from displaying code for syntax-related errors and warnings.

/recurse:wildcard

Causes the tool to process all files matching the wildcard specification in the current directory and all subdirectories.

The wildcard specification can include a path to determine where the recursion starts.

/utf8output[+|-]

Displays tool output using UTF-8 encoding.

The default for this option is /utf8output-, which means the compiler output does not use UTF-8 encoding. Specifying /utf8output is the same as specifying /utf8output+.

/verbose

Displays verbose error messages and status.

Remarks

Visual Basic 2005 specifies new reserved keywords that are not reserved in Visual Basic .NET. Source files that use the new keywords names as identifiers are not valid in Visual Basic 2005, although they are valid in previous versions of the language.

The Keyword Upgrade tool locates all instances of identifiers that are now reserved keywords in the current version of Visual Basic, and encloses them with brackets ([ ]). The tool preserves formatting and makes no other changes to the source.

Warning

Use this tool only on Visual Basic 7.0 or 7.1 source files. Other file types may be corrupted by the addition of square brackets around Visual Basic keywords.

To upgrade the source file and keep it compatible with the previous version, enclose the identifier names in square brackets. For more information on using keywords as identifier names, see Keywords as Element Names in Code.

See Also

Concepts

Keywords as Element Names in Code

Reference

Vbupgrade Command-Line Syntax

Other Resources

Visual Basic Command-Line Tools