2006-02-26
| Table of Contents: |
| Rate This Article: | Add This Article To: |
( Page 1 of 3 )
Tired of clicking yourself to death in the Visual Studio IDE? A command line switch may be just what you need.
You may not realize that the Visual Studio IDE supports command line switches, but it does. The command line switches can do everything from changing your work environment to compiling your application.
One benefit of using the command line switches, rather than locating the corresponding feature using the menu system, is that you can automate some tasks. For example, you can compile your application without even displaying the IDE.
In many cases, using a command line switch is simply convenient. For example, you can use the command line to load a local Web site directly, rather than waste time drilling down into your hard drive looking for the Web site you want to load.
Accessing the Command Line
You might think that accessing the command line is a simple matter of clicking the Start\Programs\Accessories\Command Prompt shortcut. That shortcut opens a command prompt, but it's not the right one. This command prompt lacks the required environment variables, especially the path information to Visual Studio.
Instead, open a development command line by clicking the \Start\Programs\Microsoft Visual Studio\Visual Studio Tools\2005 Visual Studio 2005 Command Prompt shortcut. The command line you see is ready for use in development applications. Of course, you can easily create your own batch files with the required environment variables. Look at the vcvarsall.bat in the \Program Files\Microsoft Visual Studio 8\VC folder of your hard drive for an example of how to create such a batch file.
You access the development environment (the IDE) using the DevEnv command. If you ever forget the command line switches found in this article, you can display a list to refresh your memory by typing DevEnv /? and pressing Enter at the command line. Generally, you'll find that you can use the command line to open a solution, project, or specific file directly, with or without special environment or task related command line switches. Here's the command line syntax for DevEnv.
DevEnv [solutionfile | projectfile | anyfile.ext] [switches]
Changing Your Environment
Many developers set their environment one time, and they never change it. However, when performing certain tasks, you may find that one environment works better than does another. For example, you might want to use a multiple document interface (MDI) environment in some cases (such as working with complex applications) and not in others (building a utility). Here's the list of environment-related command line switches and my take on using them.
Ctrl+Tab, or you can select a particular window from the Window menu. Use this option when you're focusing attention on a few documents, rather than making small changes to many documents. Using this command line switch also sets the Multiple Documents option found in the General\Environment folder of the Options dialog box.General\Environment folder of the Options dialog box.![]() |
|


