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".

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. Example:
    uedit64 file1.txt file2.txt "some file with spaces.txt"
  • Using a wildcard (*). In the following example, all files in directory C:\temp with a file extension of .c would be opened in UltraEdit:
    uedit64 d:\temp\*.c
  • Using the /f parameter set to a text file containing a list of file names. The text file should 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 open in UltraEdit / UEStudio is deleted, the application will notify you that the file no longer exists and prompt you on what to do with the file. In some situations, it may be desirable to suppress this notification. To do this, add /n to the command line. This has no effect on files already opened, or files opened after this.

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 you can 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 should 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 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 will be positioned at column 1 of the line number.

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

LineColumnChar=,

where the comma (,) may be any character except a colon (:). Keep in mind that UltraEdit will not be able to open a file that contains 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. This method should be separated from the file name with a space, and if the file name is in quotes, it should be after the quotes with a space between this and the quotes. 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. Example:

uedit64 d:\projects\juce.prj

Printing files

To print files, add /p to the command line. UltraEdit / UEStudio will automatically print all files opened and then exit after the print job is sent to the default printer.

Specifying new / original instance

Use the following flags before the file path(s) to specify whether a new instance should be launched 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

Example:

uedit64 /fni file1.txt file2.txt

Specifying a custom INI file

You can force UltraEdit / UEStudio to use a custom INI file so that the application can be launched with a different set of settings from your defaults by using the /i flag. 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 will be run.
  • the e in the above example is an optional parameter that forces the application to close when the macro has completed.
  • the 5 in the above example is an optional parameter that specifies the number of times the macro will run. If a file is specified on the command line but this isn't present, the macro will run once. If a file is not specified on the command line, the macro will 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 will run. If a macro name isn't specified here, the first macro in the file will be used.

Launching a script

You can run a script in UltraEdit / UEStudio from the command line by using the /s flag. The full path to the script (.js) file must be specified 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 will be run.
  • the e in the above example is an optional parameter that forces the application to close when the script has completed.

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 will use the settings specified for the last Find executed from within UltraEdit in regards to the "Match case," "Regular expressions," and other settings. Example:

uedit64 C:\temp\file.txt -fdog

This would open "file.txt" and search for and select the first occurrence of the string "dog" in the file.

MediaWiki spam blocked by CleanTalk.