1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Command Line Switches

From notepad-plus

Jump to: navigation, search
Controlling Notepad++ at startup by passing it Command Line Options


You can pass the arguments to Notepad++ at launch time from the command line or via a shortcut.


Contents

Synopsis

notepad++ [--help] [-multiInst] [-noPlugins] [-lLanguage]
[-nLineNumber] [-cColumnNumber] [-xPos] [-yPos]
[-nosession] [-notabbar] [-ro] [-systemtray] [-alwaysOnTop]
[-Llanguege code] [-r]

[fullFilePathName] | [-openSession sessionfilename]

Alphabetical list of supported switches

Please note that the switches are case sensitive. Help on switches is available from ? -> Command line arguments

--help
Displays an usage message box listing all switches, with a short description.
-alwaysOnTop
Starts Notepad++ as a topmost window.
-c<column number>
Use this option to scroll to the <column number> you want after opening fullFilePathName.
-l<language>
This option applies the <language> syntax highlighting to the fullFilePathName to open.
-L<<language code>
This options sets the localization to specified language code on opening fullFilePathName. Refer to Localisation for a full list.
-multiInst
Notepad++ is single-instance by default. This option allows you to launch several instances of Notepad++.
-n<line number>
Use this option to go to the <line number> you want after opening fullFilePathName.
-noPlugins
Use this parameter to launch Notepad++ without loading the plugins. This parameter is useful when you want to determine where bad behaviour or crash is coming from (from the plugins or from Notepad++ itself).
-nosession
Use this parameter to launch Notepad++ without loading the previous session (the files opened in Notepad++ at the last time). On shutdown, Notepad++ will not record currently opened files in session.xml.
-notabbar
this parameter allows users to turn off tab interface. It may be useful if users want Notepad++ behaviour to be similar to MS Notepad's one:
notepad++    -multiInst    -notabbar    -nosession   d:\file2open
-openSession <fullpathofsessionfile>
This alternative last option opens a session file as such. How the session opens can be influenced by the Multi-instance preference settings.
-r
Open files recursively, if the file name or path has any ? or * wildcard in it.
-ro
Use this parameter to open fullfilepathname in read only mode.
-systemtray
Launch Notepad++ directly in system tray
-x<x-coordinate>
Set <x-coordinate> as the initial horizontal position of Notepad++ window. Introduced in v5.4.
-y<y-coordinate>
Set <y-coordinate> as the initial vertical position of Notepad++ window. Introduced in v5.4.

fullFilePathName, surprisingly, is the absolute or relative path of file(s) you want to open. Separate multiple file paths with spaces.

Examples

Note for Windows users: Be sure to NOT put quotes around the entire command line when creating a shortcut.

This will not work: "C:\Program Files (x86)\Notepad++\notepad++.exe -openSession C:\<my path>\session.xml"

but this will: "C:\Program Files (x86)\Notepad++\notepad++.exe" -openSession C:\<my path>\session.xml

notepad++ -lxml d
\myproj\proj.vcproj
In the above example, the file proj.vcproj will be opened as an xml file, even though its extension .vcproj is not recognized as xml file extension.
notepad++ -n150 E
\notepad++\PowerEditor\src\Notepad_plus.cpp
The above will open the file Notepad_plus.cpp then scroll the view and place the cursor to the line 150.

How to pass command line switches

There are at least three ways:

  • Launching cmd.exe from Start -> Run, and typing in the full command line, after changing to Notepad++'s folder;
  • Setting shortcuts with various command lines. This has the drawback of requiring one shortcut per flavour of command line;
  • Using a third party shell extension that enables to enter a command line from the Windows GUI.
Personal tools
INVISIBLE