Upgrading Using the Command Line
Those of you who prefer using command-line tools over graphical wizards will be pleased to know that Visual Basic .NET ships with a command-line upgrade tool: VBUpgrade.exe. If you accept the default file locations during installation, you will find it installed to the following directory:
<drive>:\Program Files\Microsoft Visual Studio .NET\Vb7\VBUpgrade\
The command-line upgrade tool produces exactly the same result as the Upgrade Wizard in fact, they share the same underlying upgrade engine. Let s see it in action. Assuming that the tool resides on drive C, open a Command Prompt window and change the current directory to the location of the tool, using the CD command, as follows:
CD "C:\Program Files\Microsoft Visual Studio .NET\Vb7\VBUpgrade"
Now type the following to see the command-line options:
vbupgrade /?
The upgrade tool shows you its available options:
Microsoft (R) Visual Basic.NET Upgrade Tool Version 7.00.9238.0 Copyright (C) Microsoft Corp 2000-2001. Portions copyright ArtinSoft S.A. All rights reserved. Usage: VBUpgrade <filename> [/Out <directory>] [/NoLog /LogFile <filename>] [/Verbose] [/GenerateInterfaces] /? Display this message /Out Target directory (default is ".\OutDir") /Verbose Outputs status and results /NoLog Don't write a log file /LogFile Log file name (default is "<ProjectFileName>.log") /GenerateInterfaces Generates interfaces for public classes
To upgrade a project, you need to specify the project filename and the destination directory for the upgraded project. If the destination directory doesn t exist already, the upgrade tool will create it for you. For example, the following statement upgrades C:\Project1.vbp to the C:\Project1.NET directory:
vbupgrade c:\Project1.vbp /Out c:\Project1.NET
Because it is a command-line tool, the upgrade tool doesn t show any wizard pages while upgrading. The one difference between the command-line tool and the Upgrade Wizard is that the command-line tool does not delete any files in the destination directory. If the destination directory already contains files, the command-line tool stops with an error.