EmEditor Command Line Options

Using Command Line Options

http://www.emeditor.com/help/howto/file/file_commandline.htm

 

Command line options can be specified in the Run dialog box on the Start menu or a  Command Prompt window.

Syntax

Open a file or files

"File1" "File2" "File3" ... [/r] [/fh] [/nr] [/sp] [/l LineNumber] [/cl ColumnNumber] [/cp encoding] [/c "Config"] [/mf "MacroPath"]

Create a new file

[/cd] [/sp] [/c "Config"] [/mf "MacroPath"]

Create a new file and paste

[/i] [/cd] [/sp] [/c "Config"] [/mf "MacroPath"]

Create a new file and paste with quote

[/iq] [/cd] [/sp] [/c "Config"] [/mf "MacroPath"]

Create a new file and paste with quote and returns

[/iqr] [/cd] [/sp] [/c "Config"] [/mf "MacroPath"]

Display the Tray Icon

/ti

Print a file

"File" /p [/nr] [/sp] [/cp encoding]

Compare two files

/cmp "File1" "File2"

Convert a file encoding

"SrcFile" [/nr] [/sp] [/cp EncodingToOpen] [/c "Config"] /cps EncodingToSave /ss+ /sa "DestFile"

To save without the Unicode signature (BOM), use /ss- instead of /ss+.

Display Find in Files dialog box

/fd

Display Replace in Files dialog box

/rd

Find in files

/fc "FindWhat" [/fr] [/fw] [/x] [/fn] [/fu "FilesToIgnore"] [/cp encoding] "path"

This command is called internally when the Find button is selected in the Find in Files dialog box. To search without matching case, use /fi instead of /fc.

Replace in files

/fc "FindWhat" [/fr] [/fw] [/x] [/ko] [/fu "FilesToIgnore"] [/cp encoding] "path" /rw "RepalceWith" [/bk "BackupFolder"]

This command is called internally when the Replace All button is selected in the Replace in Files dialog box. To search without matching case, use /fi instead of /fc. /ko and /bk cannot be specified simultaneously.

Open a file and replace

"File" /rc "FindWhat" [/fw] [/x] [/cp encoding] /rw "RepalceWith"

This command is called internally during the Replace in Files process. To search without matching case, use /ri instead of /rc.

Restore workspace

/ws

This command is called internally when the Restore Workspace command is selected.

Save workspace

/wss

This command is called internally when the Save Workspace command is selected.

Grab text with EmEditor

/eh

This command is called from the Tray Icon when the shortcut key to grab text with EmEditor defined in the Customize Tray Icon dialog box is pressed.

Display Help

/?

Options

/?displays Help.
/actactivates EmEditor if it is already running, or launches EmEditor if it is not already running.
/bk "BackupFolder"specifies a backup folder when replacing in files.
/c "Config"sets the configuration.
/cacloses all documents.
/carcloses all documents including a hidden window if the "Quick Start" option is enabled.
/cdset the current directory as the default folder in the Open dialog box.
/cjlcustomizes the Jump List on Windows 7 or later.
/cl ColumnNumber logical column number.
/clwclears the workspace.
/cmpcompares two files.
/cp Encoding sets an encoding to open as.  An encoding can be one of Encoding Constants. A combination with following values can be specified.
131072Detects Unicode signature (BOM).
262144Detects UTF-8.
524288Detects HTML/XML Charset.
1048576Detects all encodings.
/cps Encoding sets an encoding to save as.  An encoding can be one of Encoding Constants.
/dispecifies the working folder when creating a new document. Used internally by EmEditor.
/ehgrabs a text box contents.
/fc "FindWhat"find in files (case sensitive).
/fddisplays the Find in Files dialog box.
/ff "FindWhat"find a string directly within the opened document. Can be combined with /mc or /x.
/fi "FindWhat"find in files (ignore case).
/fhhighlights searched strings.
/fndisplays only file names when finding in file.
/fu "FilesToIgnore"ignores the following file or folder names.
/frsearch in sub folders when finding in files (use with /fc or /fi).
/fwsearches only words.
/hideruns EmEditor as a hidden window when the "Quick Start" option is enabled.
/ipastes a text string from the Clipboard.
/ipirefreshes the plug-in list. used from plug-in installers.
/iqpastes a text string in quotes from the Clipboard.
/iqrpastes a text string in quotes and returns from the Clipboard.
/kokeeps modified files open when replacing in files.
/l LineNumber move cursor to the logical line number.
/mcmatches cases when /ff is used to find a string.
/mfspecifies a macro file to run.
/nalways start as a new file.
/ncpsuppresses "The specified file does not exist. Open as a new file?" prompt when a specified file is not found.
/nespecifies event-triggered macros should be disabled.
/nrdoes not add the file path to the recent file list.
/oddisplays the Open dialog box to select files to open.
/pprints the file.
/pos left top right bottomspecifies the window position with four integers (left, top, right, bottom).
/rread-only mode.
/rc "FindWhat"replaces in files (case sensitive).
/rddisplays the Replace in Files dialog box.
/rhopens HTML files as read-only. Used internally.
/ri "FindWhat"replaces in files (ignore case).
/rropens files in folders recursively.
/rwspecifies a string to be replaced with.
/sa "DestFile"specifies a file name to save as after the encoding conversion.
/scasaves and closes all opened documents.
/scrlfsaves the file using CR+LF as return method after the encoding conversion.
/scrsaves the file using the CR only as return method after the encoding conversion.
/slfsaves the file using the LF only as return method after the encoding conversion.
/spspecifies that a new separate process from other EmEditor windows should be run. This option is useful when a new EmEditor window must be launched from another application because the application must monitor the process termination so it can detect the file modification. If this is specified, however, some features including tab operations will be disabled, and will void support.
/ss+saves the file with a Unicode signature (BOM) after the encoding conversion.
/ss-saves the file without a Unicode signature (BOM) after the encoding conversion.
/tidisplays the Tray Icon.
/uobuses the Output Bar to display the Find in Files results.
/xfinds or finds in files using a regular expression.
/wsrestores the workspace.
/wsssaves the workspace.

Examples

/rr *.htm

opens all .htm files including all sub folders.

/p "filename"

prints filename.

/r "filename"

opens filename in read only mode.

/c "Normal" "filename"

opens filename in the default configuration.

/l 123 "filename"

opens filename, jumps to 123rd line and display it.

/ff "what" /mc "filename"

opens filename, and finds what matching cases.

/fh

highlights string of last search.

/ti

opens as a tray icon.

/fi "ABC" "c:\Temp\*.txt"

searches for the string ABC from all files with the extension .txt on the c:\Temp folder while ignoring case.

/fi "abc" /fr /fw /fn /fu "_*;*.bak" /cp 65536 "c:\test\*.htm;*.txt"

searches for the string abc from all files with the extension .htm and .txt on the c:\test folder while ignoring case. it searches sub folders, searches only words, displays only file names, ignores file or folder names matching "_*;*.bak", and uses the system default encoding.

/fc "[a-e]" /fr /x /fu "_*;*.bak" /cp 65536 "c:\test\*.htm;*.txt"

searches for text matching a regular expression [a-e] from all files with the extension .htm and .txt on the c:\test folder while not ignoring case. it searches sub folders, ignores file or folder names matching "_*;*.bak", and uses the system default encoding.

"c:\test\utf16.txt" /cp 65537 /cps 65001 /ss- /sa "c:\test\utf8.txt" /scrlf

converts a UTF-16LE file c:\test\utf16.txt to UTF-8 without a Unicode signature and saves as c:\test\utf8.txt. The return method is converted to CR+LF.

Tips

  • The string searched for in files must be after /fc or /fi.
  • If no options are specified, the selected file will simply be opened.
  • If /c is not specified and the associated extensions of the configuration are the same, open the file with that configuration.
  • If a folder name is specified instead of a file name, the Open dialog box with that folder will be displayed.
  • Command line options are case sensitive. For instance /r will not be recognized if written as /R.
  • Escape seaquences are always on when searching from the command line.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值