Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
61 lines (49 sloc) 1.82 KB
title ms.date ms.prod ms.technology ms.topic f1_keywords helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Open File Command | Microsoft Docs
11/15/2016
visual-studio-dev14
vs-ide-general
reference
file.openfile
Open File command
File.OpenFile command
of command
a51a83fc-e3c6-4fa2-8882-8b7b6c0a6406
20
jillre
jillfra
jillfra

Open File Command

[!INCLUDEvs2017banner]

Opens an existing file and allows you to specify an editor.

Syntax

File.OpenFile filename [/e:editorname]

Arguments

filename Required. The full or partial path and file name of the file to open. Paths containing spaces must be enclosed in quotation marks.

Switches

/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"

Remarks

As you enter a path, auto completion tries to locate the correct path and file name.

Example

This example opens the style file "Test1.css" in the source code editor.

>File.OpenFile "C:\My Projects\project1\Test1.css" /e:"Source Code (text) Editor"

See Also

Visual Studio Commands Command Window Immediate Window Find/Command Box Visual Studio Command Aliases

You can’t perform that action at this time.