Categories


Popular topics

UltraEdit and UEStudio support several command line parameters for launching the application from the Windows command prompt. By default, UltraEdit / UEStudio are added to your user %PATH% environment variable on install so that you can invoke the application from any directory. UltraEdit can be invoked from the command line by using either "uedit32" or "uedit64" for the 32-bit and 64-bit versions, respectively. UEStudio (both 32-bit and 64-bit) can be invoked from the command line by using "uestudio".

Format / description

Command line calls should use the following format. All except for [appname] are optional.

[appname] [instance] [file path(s)][linenum/colnum] [options]

appname

uedit32
Launch the 32-bit version of UltraEdit.
uedit64
Launch the 64-bit version of UltraEdit.
uestudio
Launch the 32-bit or 64-bit version of UEStudio.

instance

/fni
Open in a new instance of the application.
/foi
Open in the original (first) instance of the application. See Specifying new / original instance.

file path(s)

(path) You must separate each file path by a space and use quotes for file paths containing spaces. Wildcards are supported. See Opening multiple files for more options and functionality.
/f <path>
Use the /f parameter to open a list of files within a separate text file. The file list path must immediately follow the /f parameter, separated by a space. See Opening multiple files for further documentation and examples.

linenum/colnum

/<ln>/<cn>
The line <ln> and column <cn> number to which you want to open the file. Note that there must be no whitespace between the file path/name and the line and column number, if they are specified.
-l<ln> -c<ln>
Alternate syntax for the above; must immediately follow the file name, separated by a space.

options

/p
Prints file(s) opened by a command line call, and then exits the application.
/m,e,<n>=<path>/<macro>
Load a macro file at <path>, and then play <macro> <n> times. The ,e specifies that the application should exit after the macro runs.
/s,e=<path>
Play the script at <path>. The ,e specifies that the application should exit after the script runs.
-f<string>
Search for and select the first occurrence of <string> immediately after opening a file.
/i=<path>
Load and use the settings from the INI file at <path>. See Specifying a custom INI file for further documentation and examples.

Opening files

You can open a file in UltraEdit via the command line by entering the file path / name immediately after the application name. For example:

uedit64 d:\projects\juce\juce.h

Opening multiple files

You can open multiple files by:

  • Listing each file separately via a space. For example:
    uedit64 file1.txt file2.txt "some file with spaces.txt"
  • Using a wildcard (*). In the following example, all files in directory C:\temp having a file extension of .c open in UltraEdit:
    uedit64 d:\temp\*.c
  • Using the /f parameter set to a text file containing a list of file names. The text file must contain a list of file paths and names, one per line. Example:
    uedit64 /f c:\temp\file_list.txt

Setting read-only

You can open one or more files as read-only by adding the /r flag immediately following the file name(s).

Avoiding "file deleted" prompt

When a file opened in UltraEdit / UEStudio is deleted, the application notifies you that the file no longer exists, and then prompts you on what to do with the file. In some situations, you may want to suppress this notification. To mute notifications, add /n to the command line. This action has no effect on files already opened, or files opened after taking action.

Avoiding "reload file" prompt for files already open

When launching UltraEdit / UEStudio from another application, it may be necessary to invoke it with a file that is already open to position at a specific line or column. In this case, add /a to the command line, and if present, UltraEdit / UEStudio will not show the prompt to reload the file and lose unsaved changes.

Opening to specific line / column number

You can specify the line and column number at which to position the caret when the file is opened. To do this, the line number and column number must follow the file name, immediately separated from the file name by a / character. For example:

uedit64 d:\projects\juce\juce.h/5/2

The above example opens the file "juce.h" with the caret positioned at line 5, column 2. You can specify the line number only if you'd like; in this case, the caret is positioned at column 1 of the line number.

If you want to use a different character for the line / column separator, add the following line to the INI file:

LineColumnChar=,

where the comma (,) may be any character except a colon (:). Keep in mind that UltraEdit cannot open a file containing any special character you set for this.

You can also use -lx and / or -cx following the file name(s), where x is the line or column number. You can specify this individually after each file name. Separate this method from the file name with a space, and if the file name is in quotes, include a space after the quotes before adding this code. For example:

uedit64 file1.txt file2.txt -l10 -c25 "some file with spaces.txt" -l256 -c3

Opening projects

You can open a project in UltraEdit / UEStudio via the command line by using the same syntax for opening files. Project files (.prj), when opened in either UltraEdit or UEStudio, are automatically recognized and opened as projects rather than the files being opened themselves. For example:

uedit64 d:\projects\juce.prj

Printing files

To print files, add /p to the command line. UltraEdit / UEStudio automatically prints all files opened, and then exits after sending the print job to the default printer.

Specifying new / original instance

Use the following flags before the file path(s) to specify whether you want to launch a new instance for opening the files, or to use the original instance regardless of the Allow multiple instances setting in Settings » Application layout » Miscellaneous:

  • /foi forces UltraEdit / UEStudio to use the original (already running) instance.
  • /fni forces UltraEdit / UEStudio to open the file(s) specified on the command line in a new instance.

For example:

uedit64 /fni file1.txt file2.txt

Specifying a custom INI file

You can force UltraEdit / UEStudio to use a custom INI file so you can launch the application with a different set of settings from your defaults by using the /i flag. For example:

uedit64 /i="C:\Path\To Custom\uedit64.ini"

The INI file does not need to exist in order for it to be created in the custom directory. The name of the custom INI is arbitrary, but the extension must always be ".ini".

Launching a macro

You can run a macro in UltraEdit / UEStudio from the command line by using the /m flag. The full path to the macro (.mac) file must be specified in quotation marks. For example:

uedit64 C:\temp\file.txt /m,e,5="C:\Users\bschwenk\Documents\UltraEdit Macros.mac/cleanFile"

In the above example:

  • the file name "C:\temp\file.txt" is the file on which the macro run.
  • the e in the above example is an optional parameter that forces the application to close when the macro completes.
  • the 5 in the above example is an optional parameter that specifies the number of times the macro runs. If a file is specified on the command line but this isn't present, the macro runs only once. If a file is not specified on the command line, the macro does not run unless the number of times is specified.
  • the /cleanFile in the above example is the name of the macro within the "UltraEdit Macros.mac" file that application runs. If a macro name isn't specified here, the first macro in the file is used.

Launching a script

You can run a script in UltraEdit / UEStudio from the command line by using the /s flag. You must specify the full path to the script (.js) file in quotation marks. For example:

uedit64 C:\temp\file.txt /s,e="C:\Users\bschwenk\Documents\UltraEdit Scripts\cleanFile.js"

In the above example:

  • the file name "C:\temp\file.txt" is the file on which the script runs.
  • the e in the above example is an optional parameter that forces the application to close when the script is complete.

Launching a find

You can launch an automatic find on open from the command line by using the -f flag, immediately followed by the search string. This must be the last parameter on the command line in order to work. For added flexibility, this parameter uses the settings specified for the last Find executed from within UltraEdit in regards to the "Match case," "Regular expressions," and other settings. For example:

uedit64 C:\temp\file.txt -fdog

This command opens "file.txt", and then searches for and selects the first occurrence of the string "dog" in the file.

Compute hash / checksum

If you wish to computer the CRC, MD5, SHA1 or SHA256 checksum on a file, you can do so with the following command line parameters:

uedit64 [/crc | /md5 | /sha1 | /sha256] c:\path\file_to_hash.exe

Example:

uedit64 /sha256 c:\temp\myBinary.exe

There is no file size limit for hash calculation, but keep in mind that larger files will require more computational resources. You can also compute the hash of the file or part of the file directly in the application. See Compute hash for more details.