Command line parameters

From TED Notepad
Revision as of 15:57, 14 November 2021 by Jsimlo (talk | contribs)
This section is up to date for TED Notepad version 6.3.1.0.
Control page Control:feature:Command line parameters
TedNPad.exe

  [ [ /l xx ] [ /c xx ] | /s p1,p2 | /a | /E ]

  [ /p ]

  [ /v ]

  [ /x xx ] [ /y yy ] [ /w ww ] [ /h hh ]

  [ /T ] [ /H ]   [ /F | /M | /m ]

  [ /b ]

  [ /A | /W | /U ]

  [ /u ]

  [ /? ]

  [ /i path ]   [ /nl ] [ /ns ]

  [ /nf path ]

  [ /nw ] [ /nn ignored ] [ /nm ignored until the end ]

  [ //p ] [ //s ]

  [drive:][path]filename

Note: All command line parameters must precede the filename to be loaded and must be delimited with at least one white-space to work properly. Since version 6.0, white-spaces between a parameter and its value are allowed. Some of the command line parameters are exclusive to each other and should not be used together, or the result may be undefined and may change from version to version.

Since version 6.3, if an unknown command line parameter is found, an error message is displayed. Prior to version 6.3, unknown command line parameters were ignored.


[drive:][path]filename

[Section link: Command line file]

This must always appear after all other parameters, and specifies a file to be loaded upon starting.

TedNPad.exe /b /a "d:\my notepad\todo.txt"

Note: For convenience, the path and file name does not have to be put inside double quotes even if it contain white-spapces, however, it is considered good practice to always use double quotes for any command line paths which may contain white-spapces.

TedNPad.exe d:\my notepad\todo.txt

See also /nf for another way to specify a file to be loaded upon starting.

/l xx Go to Line

After the file is fully loaded, moves the caret to the beginning of the line number xx. If there is no such line (too few lines in the document), the caret is positioned on the beginning of the last line of the document.

Note: Zero and negative numbers can be used as line number.

  • Zero means the last line of the document; and negative number means how many lines to go from the last line upwards, e.g. -1 means the penultimate line. Likewise to positive numbers, if there is no such line (too few lines), the caret is positioned on the beginning of the first line of the document.

This parameter can be used together with /c parameter, to further move the caret within given line.

This parameter excludes /s, /a and /E parameters.

/c xx Go to Offset

After the file is fully loaded, moves the caret to the offset xx. If there is no such offset (the document is too short), the caret is positioned to the end of the document.

Note: Zero and negative numbers can be used as offset number.

  • Zero means the end of the document, after the very last character; and negative number means how many characters to go from the end of the document upwards, e.g. -1 means before the last character. Likewise to positive numbers, if there is no such offset (the document is too short), the caret is positioned on the beginning of the document.

This parameter can be used together with /l parameter, to further move the caret within given line. If the given offset goes beyond the given line, the caret is pushed respectively further into text of the following lines, until the end of the document is reached. If zero or negative offset is given, the caret is moved naturally along previous lines, until the beginning of the document is reached. In other words, after the starting line is calculated from the /l parameter, offset calculation according to /c parameter is done relatively to the beginning of that line downwards or upwards, bound only with document boundaries.

This parameter excludes /s, /a and /E parameters.

Note: Since version 6.0, TED Notepad does not convert newlines upon loading, therefore there is no need to re-calculate offsets to match the extent of newlines conversion. However, multi-character encoding sequences still might get converted into single-character representations upon loading, e.g. in UTF-8 files.

/s xx,yy Set Selection

After the file is fully loaded, automatically sets the selection from offset number xx to offset number yy. If there is no such offset (the document is too short), the respective selection boundary is positioned to the end of the document.

Note: Zero and negative numbers can be used as offset numbers.

  • Zero means the end of the document, after the very last character; and negative number means how many characters to go from the end of the document upwards, e.g. -1 means before the last character. Likewise to positive numbers, if there is no such offset (the document is too short), the caret is positioned on the beginning of the document.

This parameter excludes /l, /c, /a and /E parameters.

/a Select All

Selects all text after the file is fully loaded.

This parameter excludes /l, /c, /s and /E parameters.

/E Go to End

After the file is fully loaded, moves the caret to the end of the document.

This parameter excludes /l, /c, /s and /a parameters.

/v Paste Clipboard

Pastes the Clipboard into the document after opening the file from the command line.

Note: Position within the document can be adjusted via /l, /c, /s, /a, or /E before the Clipboard is pasted.

/p Print

Prints the document after the file is fully loaded, then exits.

/b Create New File

Skips questions about whether to create a new file, if the file given thru command line does not exist. Without this command line parameter, TED Notepad asks, whether to create a new file, if the file to be loaded cannot be found.

/T Session on Top

Turns on Session on Top.

/H Hide to Tray

Starts with Hide to Tray.

/F Fullscreen

Starts in Fullscreen mode.

Note: Actually, it is Session in Fullscreen that is turned on instead of the regular Fullscreen mode, which means that the fullscreen state is never saved into Config upon exit as opposed to the regular fullscreen.

/M Maximized

Starts with the main window maximized.

/m Minimized

Starts with the main window minimized.

/x xx Window X Position

Starts the main window at the xx Workspace position from the left.

Note: Workspace position is Screen position with any toolbars (including the Taskbar) taken into account. Use number 0 to place the window at the left border of the Screen after any toolbars or the Taskbar on the left side.

Note: If this would result in placing the window completely off the Screen, the System should automatically adjust the coordinates to make the window visible.

See also /y and /w and /h.

/y yy Window Y Position

Starts the main window at the yy Workspace position from the top.

Note: Workspace position is Screen position with any toolbars (including the Taskbar) taken into account. Use number 0 to place the window at the top of the Screen below any toolbars or the Taskbar at the top.

Note: If this would result in placing the window completely off the Screen, the System should automatically adjust the coordinates to make the window visible.

See also /x and /w and /h.

/w ww Window Width

Starts the main window with the ww width.

See also /h and /x and /y.

/h hh Window Height

Starts the main window with the hh height.

See also /w and /x and /y.

/A ANSI

Forces loading the file from the command line in the ANSI encoding.

Note: Any BOM, or other potential encoding markers, are simply loaded as regular ANSI characters.

TedNPad.exe /A d:\my notepad\todo.txt

See also /W for Unicode and /U for UTF-8.

/W Unicode

Forces loading the file from the command line in the Unicode encoding.

Note: Any BOM, or other potential encoding markers, are simply loaded as regular Unicode characters. This means that if Unicode BOM is present in the file, it will be loaded as the first character in the document.

TedNPad.exe /W d:\my notepad\todo.txt

See also /A for ANSI and /U for UTF-8.

/U UTF-8

Forces loading the file from the command line in the UTF-8 encoding.

Note: Any BOM, or other potential encoding markers, are simply loaded as regular UTF-8 characters. This means that if UTF-8 BOM is present in the file, it will be loaded as the first character in the document.

TedNPad.exe /U d:\my notepad\todo.txt

See also /W for Unicode and /A for ANSI.

/i inifile Config INI File

Forces the application to use inifile file upon loading and saving Config.

Note: Hierarchical INI file loading and system Registry fallback do not apply, if this parameter is used. Loading of Config is strictly bound to this inifile.

TedNPad.exe /i "d:\config\ted notepad.ini" d:\my notepad\todo.txt

Note: If the inifile contains spaces, make sure to use double quotes. Double quotes are not needed only if the inifile contains no white-spaces.

//p Reset Saved Window Position

Resets the saved window position, if one is saved into Config via the save Window position setting on the Settings page of the Settings dialog.

Under the hood, this command line parameter first ignores any saved position in the Config, then unchecks the saving of the Window position in the Settings dialog, and finally saves special window position values into the Config upon exit, to avoid Window position being read from more global Cascading Portable INI files.

Note: The main editor window opens at position assigned by the system, and can then be used as normal, but the save Window position setting on the Settings page of the Settings dialog cannot be used to save any new Window position. Those special window position values will be written into the Config upon exit, unless the aplication is exited without saving any settings, e.g. via Exit without saving!

Note: Do not use this command line parameter with /ns, as that would prevent saving the Config upon exit, keeping the old saved window position. Unless you want to reset saved Window position only for that specific window session.

Note: Command line parameters /x and /y will still work with //p, but they will not be saved into the Config upon exit. Note that /x and /y always take precedence over any saved Window position.

Note: The double slash in this command line parameter (i.e. //p) is not a typo.

TedNPad.exe //s //p

See also //s to Reset Saved Window Size.

//s Reset Saved Window Size

Resets the saved window size, if one is saved into Config via the save Window size setting on the Settings page of the Settings dialog.

Under the hood, this command line parameter first ignores any saved size in the Config, then unchecks the saving of the Window size in the Settings dialog, and finally saves special window size values into the Config upon exit, to avoid Window size being read from more global Cascading Portable INI files.

Note: The main editor window opens with size assigned by the system, and can then be used as normal, but the save Window size setting on the Settings page of the Settings dialog cannot be used to save any new Window size. Those special window size values will be written into the Config upon exit, unless the aplication is exited without saving any settings, e.g. via Exit without saving!

Note: Do not use this command line parameter with /ns, as that would prevent saving the Config upon exit, keeping the old saved window size. Unless you want to reset saved Window size only for that specific window session.

Note: Command line parameters /w and /h will still work with //s, but they will not be saved into the Config upon exit. Note that /w and /h always take precedence over any saved Window size.

Note: The double slash in this command line parameter (i.e. //s) is not a typo.

TedNPad.exe //s //p

See also //p to Reset Saved Window Position.

/nl Don't Load Settings

Skips any attempts to load Config from system Registry or Cascading Portable INI files. Can be used to quicken the application start-up, or for any kind of troubleshooting.

TedNPad.exe /nl /ns d:\my notepad\todo.txt

/ns Don't Save Settings

Skips any attempts to save Config into system Registry or Cascading Portable INI files. Can be used to quicken the termination of the application, or for any kind of troubleshooting.

Note: The Save checked button in the Settings dialog won't work as well. See section Settings page of the Settings dialog.

TedNPad.exe /nl /ns d:\my notepad\todo.txt

/nf file Load File

Specifies the file to be loaded from the command line. If for any reason specifying such file after all the parameters is prooving problematic, use this alternative /nf to give the file right away.

Note that any regular command line file, which would normally be found after the last parameter, will simply be ignored, if /nf is given.

TedNPad.exe /nf "d:\my notepad\todo.txt" /b this is now ignored because /nf was given already

See also /nn and /nm to explicitly ignore parts of the command line.

Note: Regular command line file to be loaded, found after the last parameter, does not need to be put in double quotes, even if it contains spaces. This is for user convenience, and only applies there, after the last parameter. In contrast, when specifying file to be loaded via /nf, double quotes are needed if the path or the file name contains any white-spaces. Double quotes can be omitted only when there are no white-spaces.

Tip: Mnemonic: now file.

/nw Ignore Unknown Parameters

Ignores any unknown parameters given on the command line.

If for any reason parameters unknown to TED Noptepad must be present on the command line, this can stop TED Noptepad complaining about them.

Prior to version 6.3.1, unknown command line parameters were always silently ignored. Since version 6.3.1, /nw is required to keep silently ignoring unknown switches.

TedNPad.exe /nw /Z d:\my notepad\todo.txt

Note: TED Noptepad does not understand /Z, but that is okay thanks to /nw.

See also /nn and /nm to explicitly ignore parts of the command line.

Tip: Mnemonic: no worries.

/nn ignored Ignore This Parameter

Ignores one command line string following the /nn parameter. This can be a single space-separated collection of characters, or it can be a single double-quoted string.

If for any reason things unknown to TED Noptepad must be present on the command line, this can help stopping TED Noptepad wondering about them.

TedNPad.exe /nn ignored /b /nn "ignored again" d:\my notepad\todo.txt

Note: The /b parameter is not ignored, even though it is found between two ignored parts of the command line. Also, the file name to be loaded ,given at the end of the command line, is not ignored.

Tip: Mnemonic: no next.

/nm ignored until the end Terminate Command Line

Ensures that nothing following /nm will be considered as part of the command line.

If for any reason things unknown to TED Noptepad must be present on the command line, this can stop TED Noptepad taking them into account.

Command line parameter /nf might be needed to specify a file to be loaded before /nm is found.

TedNPad.exe /nf "d:\my notepad\todo.txt" /nm c:\debugger.exe /Z # this is now ignored because /nm was given already

See also /nn to ignore middle parts of the command line, and /nf to provide a file to be loaded even with /nm present.

Tip: Mnemonic: no more.

/na No Lengthy Asserts

(this parameter is only available in testing versions, do not use it in public releases)

Skips lengthy storage asserts after each text operation. With small files, this is usually not necessary. However, storage assertions can become a big nuisance with larger files. This parameter allows to skip the most lengthy tests, it does not, however, disable all testing routines.

/d xx Do Command

(temporary parameter, officially unpublished, subject to change without notice)

This parameter can be used to directly auto-invoke an xx action in TED Notepad, after the application starts up and loads the file from the command line. While the xx is a number of action to invoke, list of action numbers is not available yet. However, using various tools, advanced users can perhaps find these numbers out on their own, since these action numbers are the command numbers used by the application menu and accelerators.

Caution: This parameter was a long-shot attempt to provide macro support, and was never finished. Action numbers may change silently from version to version. Behavior of this parameter may be modified silently as well.

/u Check for Updates

Instead of launching the application and opening a document, connects to the application homepage and checks for available updates. Displays a message box upon new version and allows to open the official download page.

Note: Result of the last check is also displayed in the Status Bar as a hint from time to time.

TedNPad.exe /u

/? Manual

Launches the Manual, then exits.

TedNPad.exe /?