A set of files to load can be specified on the command line when starting 010 Editor. Each file to load should be separated by a space. For example, to load two files use:
010editor file1.dat file2.dat
Multiple files can be loaded on the command line by using the wildcards '*' and '?'. For example:
010editor *.bin file???.dat
By default, when 010 Editor is installed it is placed in the system path. This means that 010 Editor can be run from any command line by entering '010editor' (no directory needs to be specified).
This command line syntax can be used to load files even if 010 Editor is already running.
To not place 010 Editor in the path, disable the 'Add 010 Editor to the system path' toggle in the install program.
Drives can be opened from the command line by using the -drive: command, followed by either a drive label or a drive number. If a drive label is specified, a logical drive is opened and if a drive number is specified, a physical drive is specified (see Editing Drives for more information). For example:
010editor -drive:C -drive:1
would open logical drive C: and physical drive 1.
Processes can be opened using the -process: command, followed by either a process identification number or a name of a process. For more information on working with processes, see the Editing Processes help topic. For example, to open two processes from the command line use:
010editor -process:cmd.exe -process:1074
To import any of the available file formats, use the -import: command, followed by the file to load. Any of the accepted import or export types are accepted and the type used will be based from the file extension (see Importing/Exporting Files for more information). For example, to import a C file use:
The wildcard characters '*' and '?' can also be used to import multiple files at the same time.
Position the Caret
The caret can automatically be positioned within a file using the -line: or -goto: commands. Specify -line: followed by a number to jump to that line within the file. For example:
010editor file1.txt -line:100
To jump to a specific address within a file use the -goto: command followed by a number and the number may be in any of the supported numeric formats. For example:
010editor file1.dat -goto:0x20
All the options from the Goto Bar are available, including using '+' or '-' to jump relative the current location or '<' to jump relative the end of the file. For example, to skip over 32 bytes use:
Using -goto: to jump to a line, sector or word is also possible by including either ',l', ',s' or ',w' at the end of the command respectively. For example, to jump to sector 0x100 in a file use:
Note that versions of 010 Editor before version 6 could use '@' to jump to a location. This syntax is still allowed in version 6 but will be deprecated in future versions.
Selections can be made in a file using the command -goto:<start>:<size>. Note that start and size refer to bytes and any of the standard numeric formats are accepted. For example, to select 4 bytes starting from address 16 use:
If start is empty, the selection is started from the current caret position which can be controlled with the -goto command. For example, to select 0x200 bytes starting from the caret position use:
Opening Scripts or Templates
Scripts or Templates can be run from the command line using the -script: or -template: command respectively. See Introduction to Templates and Scripts for more information on Templates and Scripts. To run the script IsASCII for example, use:
The file to run must exist in either the current directory, the current 'Scripts' directory if running a script, or the current 'Templates' directory if running a template (these directories can be modified in the Compiling Options). To open the Script or Template in the interface without running the file, specify a '@' symbol and a line number after the filename. For example, to open the ZIP.bt file and position the caret on the 3rd line, use:
Command line arguments can be passed to a script or template by using the syntax
:(<arg1>,<arg2>,...,<argN>) after the script or template command. For
would pass the two arguments "15" and "Test" to the MyScript.1sc script. To include spaces in any of the arguments,
place double quotes around the whole command. The arguments can be retrieved in the
script or template using the GetNumArgs, GetArg
and GetArgW functions.
Saving and Closing Files
The current open file can be saved to disk by using the -save command. To save a file to a different file name, use the command -save:<filename>. For example:
010editor temp.txt -save:temp.txt.bak
To save all modified files use the -saveall command or to close the current file, use the -close command.
Replacing Strings or Bytes
A string or a set of bytes can be replaced from the command line using the -replace:<find_value>:<replace_value> command. For example:
010editor temp.txt -replace:apple:orange
would replace all occurrences of apple with orange in the file temp.txt. Note that if there are spaces in any of the replace strings, surround the whole -replace command with double quotes. The replacement options can be controlled, and special characters can be inserted into strings through the use of escape codes which start with the character '\'. The following special escape codes can be used:
\m = match case|
\w = match whole word
\p = pad with zeros
\a = perform replacement on all open files
\* = search with wildcards
\\ = insert a '\' character
\: = insert a colon
\' = insert double quotes "
For example, to replace the string 'first' with 'second' using the match case and whole word options, use:
Different data types can be indicated using a comma and type specifier after the value
(e.g. ',h' indicates hexidecimal bytes). For example, use
to replace Windows linefeeds with
Unix linefeeds. See the Find dialog for a list of type
Two files can be compared from the command line using the -compare:<fileA>::<fileB> or the
-compare:<fileA>::<fileB>::<options> command. For example:
would run a regular binary comparison on the two given files. Notice the double-colon '::' between the file names and if there are spaces in either file name, surround the whole -compare command with double quotes. To specify options for the comparison, use another double-colon '::' after the second file name and specify one or more of the following special escape codes (note that 'XXX' indicates a number):
\b = byte by byte comparison|
\i = ignore case
\e = enable synchronized scrolling
\t = enable synchronized template results scrolling
\xXXX = max look-a-head
\nXXX = min match length
\qXXX = quick match length
\saXXX = limit start for file A
\sbXXX = limit start for file B
\zaXXX = limit size for file A
\zbXXX = limit size for file B
For example, to compare two files and ignore the case, use:
or to limit the comparison to the first 16 bytes of each file, use:
See Comparing Files for an explanation of the different options for comparisons. Note that if a Max Look-a-head, Min Match Length, or Quick Match is not specified
the values from the last time the Compare dialog was run will be used. Running '010editor -compare:' will give a list of all comparison options.
Running 010 Editor in Batch Files
If running 010 Editor from a batch file, it is possible to pass error level codes from a script or template back to the batch file. First, in a script or template call the function Exit with an error code (e.g. 'Exit(95);'). Next, in a batch file start 010 Editor by using the syntax 'start /wait 010editor ...'. Afterwards the error code can be accessed in the batch file using the variable %ERRORLEVEL%. For example:
start /wait 010editor test.txt -template:test.bt -exit
Running 010 Editor without a User Interface
When running 010 Editor from the command line, the software can be executed without
a user interface by specifying the -noui command. In this mode, the splash screen
and main window of 010 Editor are not displayed and the program will exit automatically
when all the command line options are executed. Note that in this mode, messages boxes
may still be displayed on error messages and this may stop program execution until the
message box is cleared by the user. To disable the display of any message boxes,
include the -nowarnings option on the command line. The -noui command
line option is very useful when running 010 Editor from a batch file (see above).
Opening Projects and Workspaces
Open projects or workspaces using the -project: command, followed by the file name of the project or workspace to load. Project files have extension ".1pj" and workspace files have extension ".1wk". See the Using Projects and Workspaces help topic for more information. For example, to open the Manual.1pj project use:
Setting the Starting Address
When editing a hex file, the first byte in the file usually has address zero. Use -startaddress: followed by an address to set the address of the first byte. See the Custom Starting Address help topic for more information. For example, to set the starting address of a hex file to 0x5F0000 use:
010editor file1.dat -startaddress:0x5F0000
The -safe command starts 010 Editor in safe mode. In this mode no scripts or templates are run on startup and this is useful if a script or template was crashing and causing 010 Editor to not start correctly.
Resetting the Application
Options for 010 Editor can be reset by using the command line. Specify the -resetdocks command on startup to reset just the docking panel positions. Specify -resetall to revert all application settings to their defaults. If 010 Editor will not startup, specifying -resetdocks or -resetall will usually fix the problem.
Reinstalling the Application
On Linux, macOS, or Windows Portable, the -install command can be used to perform the installation steps done when 010 Editor was run for the first time. This currently includes displaying the End-User License Agreement (EULA), checking if the application has been added to the system path (Linux and macOS only), and creating desktop icons and associations (Linux only). The -install command can be run if the application location has changed and the system paths need to be updated.
Exiting the Application
Use the -exit command to shut down 010 Editor from the command line (all unsaved modifications will be lost).
Alternately the -exitnoerrors command can be used to shut down 010 Editor only if
no errors occurred. Here an error is defined to be a Script or Template that did not compile
or execute properly, or a Script or Template that was halted using the Exit
function with a negative error code.
On Linux, 010 Editor can be run using the Wayland display server protocol by executing:
010editor -platform wayland
Other Command Line Parameters
The -readonly command can be used to set the last opened file, drive, or process to Read Only and the -readonlyall command sets all open files as Read Only. The -h command will display this manual page.