Home » Products » UEStudio » UES Tour » Run DOS commands

UEStudio integrated development environment tour: run DOS commands

The UEStudio tour is intended to guide you through some of the advanced IDE features of the application. UEStudio includes all of the features of UltraEdit, the world's best text editor, which are not covered here.

UEStudio tour: run DOS commands

You may find it useful to run other applications from the command line for handling recurring tasks. When you know exactly what you need to do to invoke the desired application, the run DOS command option in UEStudio allows a DOS command to be run from within UEStudio and the results of the command are captured and automatically displayed with UEStudio at the completion of the command.

A dialog box is presented that allows the command to be specified (with a browse button) and the working directory to be specified

Run DOS Command from within UEStudio

The command line specified should be the full path of the file to be executed unless it is a system command (such as 'dir'?), or it is in the Windows directory, or the Windows system directory.

The working directory should be the full path of the working directory, or left blank if not required.

In order to allow maximum flexibility of programs to be run, a special command line sequence is permitted that will cause the active filename to be inserted into the command line and passed to the program to be executed. For example...

You set up a command to run a compiler and you want to invoke the compiler with the file you are currently editing. If you change files you want the compiler to be invoked with the new file. The compiler is c:\comp\compiler.

Specify the following command in the dialog box:

c:\comp\compiler %F

When the command is executed, the %F will be replaced by the full directory path, filename and extension of the active window, The file will be saved before the command is executed.

The following commands may be used to pass a portion of the full qualified filename:

%PPath only ("C:\project\test\")
%Nfile Name only ("test")
%EExtension only (".c")

%P%N%E is equal to %F which is ("C:\project\test\test.c") in the example above.

Note: If the %f, %p, %n, %e are lower case the filenames are passed as long filenames and should be put in quotes, i.e. "%f" or "%p%n" etc. If the %F, %P, %N, %E are in upper case the filename and path will converted and passed as the "8.3" short filename specification for maximum compatibility with DOS programs.

Additionally the following commands are available:

%RThis may be used for the full path/name of the project (%r for long name, %R for short name)
%RPThis may be used for the full project path (%rp for long name, %RP for short name)
%RNThis may be used for the project name only (%rn for long name, %RN for short name)
%modify%In some cases it may be necessary to modify the command line parameters each time the tool is run. To do this, add %modify% in the command line and when the tool is run a dialog box will be shown allowing the user to modify the command line or cancel and run without modification.
%sel%This instructs UEStudio to add the highlighted/selected text from the active document into the command line in place of the %sel%.
%EnvThis allows the user to use an environment variable in the command. The environment variable immediately follows the %Env: and UEStudio replaces this with the contents of the matching environment variable.
%line%This instructs UEStudio to add the line number of the cursor into the command line in place of the %line% - 1 is the first line.
%col%This instructs UEStudio to add the column number of the cursor into the command line in place of the %col% - 1 is the first column.

The output from the command will be captured and displayed in a window when the command has completed.

As the output from a DOS program is sometimes buffered by the operating system, this process may not work correctly with a program that requires interaction while it is executing, the prompts may not appear on the screen at the correct time and the user may wonder why there is no activity.

The output will always be captured. If the program generates no console screen output the captured output may be empty and UEStudio will show an empty window.

If the show DOS box checkbox is checked, a DOS window will be shown as the command is being executed, otherwise the DOS window will be hidden.

Note: If capturing the output does not work correctly, or the command does not function correctly you may try the alternate capture method command from the advanced menu.

The last DOS command repeats the last command specified with the DOS command dialog without presenting the dialog box.

UEStudio tour topics

Back to top