Command Line Switches
You can pass the arguments to Notepad++ at launch time from the command line or via a shortcut.
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
- Displays an usage message box listing all switches, with a short description.
- Starts Notepad++ as a topmost window.
- -c<column number>
- Use this option to scroll to the <column number> you want after opening fullFilePathName.
- 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.
- 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.
- 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).
- 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.
- 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.
- Open files recursively, if the file name or path has any ? or * wildcard in it.
- Use this parameter to open fullfilepathname in read only mode.
- Launch Notepad++ directly in system tray
- Set <x-coordinate> as the initial horizontal position of Notepad++ window. Introduced in v5.4.
- 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.
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
- 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
- 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.