Command Line Switches
From notepad-plus
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]
[fullFilePathName]
Alphabetical list of supported switches
- --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.
- -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
- -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
- 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.
