Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Reference
Command Window
 New File Command

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Studio
New File Command

Creates a new file and opens it. The file appears under the Miscellaneous Files folder.

File.NewFile [filename] [/t:templatename] [/editor:editorname]
filename

Optional. Name for the file. If no name is supplied, a default name is provided. If no template name is listed, a text file is created.

/t:templatename

Optional. Specifies the type of file to be created.

The /t:templatename argument syntax mirrors the information found in the New File Dialog Box. Enter the category name followed by a backslash (\) and the template name, and enclose the entire string in quotation marks.

For example, to create a new Visual C++ source file, you would enter the following for the /t:templatename argument.

/t:"Visual C++\C++ File (.cpp)"

The example above indicates that the C++ File template is located under the Visual C++ category in the New File dialog box.

/e:editorname

Optional. Name of the editor in which the file will be opened. If the argument is specified but no editor name is supplied, the Open With dialog box appears.

The /e:editorname argument syntax uses the editor names as they appear in the Open With Dialog Box, enclosed in quotation marks.

For example, to open a file in the source code editor, you would enter the following for the /e:editorname argument.

/e:"Source Code (text) Editor"

This example creates a new Web page "test1.htm" and opens it in the source code editor.

>File.NewFile test1 /t:"General\HTML Page" /e:"Source Code (text) Editor"
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker