Categories


Popular topics

m (Compute hash / checksum)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:General]]
 
[[Category:General]]
 
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'''".  
 
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.
 +
 +
<pre>[appname] [instance] [file path(s)][linenum/colnum] [options]</pre>
 +
 +
===appname===
 +
{|
 +
|<pre>uedit32</pre>
 +
|launch UltraEdit (32-bit version)
 +
|-
 +
|<pre>uedit64</pre>
 +
|launch UltraEdit (64-bit version)
 +
|-
 +
|<pre>uestudio</pre>
 +
|launch UEStudio (32-bit or 64-bit version)
 +
|}
 +
 +
===instance===
 +
{|
 +
|<pre>/fni</pre>
 +
|Open in a new instance of the application
 +
|-
 +
|<pre>/foi</pre>
 +
|Open in the original (first) instance of the application. See [[#Specifying new / original instance|Specifying new / original instance]].
 +
|}
 +
 +
===file path(s)===
 +
{|
 +
|(path)
 +
|Each file path should be separated by a space (use quotes for file paths containing spaces). Wildcards are supported. See [[#Opening multiple files|Opening multiple files]] for more options and functionality.
 +
|-
 +
|<pre>/f <path></pre>
 +
|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|Opening multiple files]] for further documentation and examples.
 +
|}
 +
 +
===linenum/colnum===
 +
{|
 +
|<pre>/<ln>/<cn></pre>
 +
|The [[#Opening to specific line / column number|line '''&lt;ln&gt;''' and column '''&lt;cn&gt;''' number]] to open the file to. Note that there must be no whitespace between the file path/name and the line and column number, if they are specified.
 +
|-
 +
|<pre>-l<ln> -c<ln></pre>
 +
|Alternate syntax for the above; must immediately follow the file name, separated by a space.
 +
|}
 +
 +
===options===
 +
{|
 +
|<pre>/p</pre>
 +
|Prints file(s) opened by command line call and then exits the application.
 +
|-
 +
|<pre>/m,e,<n>=<path>/<macro></pre>
 +
|Load a macro file at '''&lt;path&gt;''' and play '''&lt;macro&gt;''' '''&lt;n&gt;''' times. The ''',e''' specifies that the application should exit after the macro is run.
 +
|-
 +
|<pre>/s,e=<path></pre>
 +
|Play the script at '''&lt;path&gt;'''. The ''',e''' specifies that the application should exit after the script is run.
 +
|-
 +
|<pre>-f<string></pre>
 +
|Search for and select first occurrence of '''&lt;string&gt;''' immediately after opening file.
 +
|-
 +
|<pre>/i=<path></pre>
 +
|Load and use the settings from the INI file at '''&lt;path&gt;'''. See [[#Specifying a custom INI file|Specifying a custom INI file]] for further documentation and examples.
 +
|}
  
 
==Opening files==
 
==Opening files==
Line 12: Line 74:
 
* Listing each file separately via a space. Example:<br><code class="cmd">uedit64 file1.txt file2.txt "some file with spaces.txt"</code>
 
* Listing each file separately via a space. Example:<br><code class="cmd">uedit64 file1.txt file2.txt "some file with spaces.txt"</code>
 
* Using a wildcard (*). In the following example, all files in directory '''C:\temp''' with a file extension of .c would be opened in UltraEdit:<br><code class="cmd">uedit64 d:\temp\*.c</code>
 
* Using a wildcard (*). In the following example, all files in directory '''C:\temp''' with a file extension of .c would be opened in UltraEdit:<br><code class="cmd">uedit64 d:\temp\*.c</code>
* 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:<br><code class="cmd">uedit64 /f=c:\temp\file_list.txt</code>
+
* 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:<br><code class="cmd">uedit64 /f c:\temp\file_list.txt</code>
  
 
===Setting read-only===
 
===Setting read-only===
Line 91: Line 153:
  
 
This would open "file.txt" and search for and select the first occurrence of the string "dog" in the file.
 
This would open "file.txt" and search for and select 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:
 +
 +
<code class="cmd">uedit64 [/crc | /md5 | /sha1 | /sha256] c:\path\file_to_hash.exe</code>
 +
 +
Example:
 +
 +
<code class="cmd">uedit64 /sha256 c:\temp\myBinary.exe</code>
 +
 +
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.

Latest revision as of 21:01, 31 July 2020

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 UltraEdit (32-bit version)
uedit64
launch UltraEdit (64-bit version)
uestudio
launch UEStudio (32-bit or 64-bit version)

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) Each file path should be separated by a space (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 open the file to. 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 command line call and then exits the application.
/m,e,<n>=<path>/<macro>
Load a macro file at <path> and play <macro> <n> times. The ,e specifies that the application should exit after the macro is run.
/s,e=<path>
Play the script at <path>. The ,e specifies that the application should exit after the script is run.
-f<string>
Search for and select first occurrence of <string> immediately after opening 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. 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.

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.

MediaWiki spam blocked by CleanTalk.