User to user discussion and support for UltraEdit, UEStudio, UltraCompare, and other IDM applications.

Help with setting up and configuring custom user tools in UltraEdit (based on command line input)
5 posts Page 1 of 1
Hello,
I'm still working on the usage of the UEDOS32.exe.
I'm trying to complete what I've started on http://www.ultraedit.com/forums/viewtopic.php?f=12&t=10120.

I now want to open the output file from my compilation.

So, my batch file is now:
Code: Select all
@echo off
set EclipseFile=%~1
set EclipseDATA=%~n1
title Eclipse: %EclipseDATA%
echo Schlumberger Eclipse
echo.
echo DATA: %EclipseDATA%
echo.
echo PATH: %EclipseFile%
echo.
echo.
echo.
C:\ecl\macros\eclrun.exe eclipse "%EclipseFile%"
echo.
echo.
echo.
echo DATA: %EclipseDATA%
echo.
echo PATH: %EclipseFile%
set EclipseFile=
set EclipseDATA=

And I want to open the output file that is on the same folder with a name very like the input file.
The output is (same name, different extension "MSG"):
Code: Select all
set EclipseMSG=%~n1.MSG

So, how do I open a file with UE from the UEDOS32.exe?
I must add that I don't have the .MSG or the .DATA associated to UE in Windows.

Ideas?
Thanks!
UltraEdit 16.30.0.1003
UltraCompare Professional 7.20.0.1009
Windows Vista Enterprise, 64 bits, Spanish
You can call from within the batch file uedit32.exe with the output file name like

"full path to uedit32.exe\uedit32.exe" "%EclipseMSG%"

But if you don't have checked configuration setting Allow multiple instances it does probably not work in this way because the running UltraEdit instance is currently executing a tool and capturing its output and therefore is not ready for taking over the parameter of another UE instance started from within the batch file.

You can use following command line in your batch file to open the output file in a new instance of UltraEdit:

"full path to uedit32.exe\uedit32.exe" /fni "%EclipseMSG%"

But when you have checked the option to capture the output of the tool to the output or a document window it is perhaps not necessary to open the output file in UltraEdit. Just print the content of the output file to device stdout of the DOS window and UE captures it and so you see the output. This can be done with following command line:

if exist "%EclipseMSG%" type "%EclipseMSG%"

Of course that works only for text output and not for binary output. The left part if exist "%EclipseMSG%" is just an additional check to make sure that the file really exists before its content is printed to the window using command type.
Best regards from Austria
There is no way to get to the uedit32.exe without knowing the full path?
Something like:

Code: Select all
"%UEPATH%\uedit32.exe" "%EclipseMSG%

I mean, I want to share this .BAT and I don't know where everybody has installed it own copy of uedit32.exe.
I need some way to pass to the .BAT the path of UE.

Also, I don't trust the UE DOS capture, because when I run more than one compilation... I don't get every single output on UE, some of the outputs are just missing.
UltraEdit 16.30.0.1003
UltraCompare Professional 7.20.0.1009
Windows Vista Enterprise, 64 bits, Spanish
pepemosca wrote: Also, I don't trust the UE DOS capture, because when I run more than one compilation... I don't get every single output on UE, some of the outputs are just missing.

The feature to capture output from the devices stdout and stderr of the called tool works perfect. Of course uedos32.exe can't capture output printed to stdout and stderr of another environment. So if some of your tools create a new console process (using cmd.exe, dos4gw.exe, etc.), uedos32.exe can't capture their output. That's the same as trying to capture from within batch file A started from Windows Explorer the output of batch file B started from within UltraEdit or also from Windows Explorer. Batch file A is running in a different process environment than batch file B. Both have stdout and stderr, but not shared, they are separated. Using free Process Explorer from SysInternals (Microsoft) which is an enhanced task manager, you can see not only the running processes, you see also the process tree and with right clicking on a process, opening Properties and clicking on tab Environment you can see the CURRENT environment variable memory of this process.

So when you print with command type whatever your tool has written into a text file, you can be sure that uedos32.exe capture it always correct.

However, I created a batch file containing only the word set, added a tool to call this batch file from within UltraEdit and captured the output of this batch file to a document window. Now I could see which environment variables are defined on start of a console application from within UltraEdit.

The only environment variable helpful for your need is UEHELPATH containing full name of the help file of the instance of UltraEdit starting the tool. The help file is stored usually in the same directory as the UltraEdit executable and has the same name as the UltraEdit executable, just the file extension is CHM instead of EXE. So all to do is replace the file extension CHM by EXE to get full name of UltraEdit executable. This can be done with the command line:

set UENAME=%UEHELPATH:~0,-3%exe

Now the environment variable UENAME contains full name of the UltraEdit executable and so you could use

"%UENAME%" /fni "%EclipseMSG%"

:~0,-3 is explained in help of command set. Just use in UltraEdit Advanced - DOS Command with the command set /? to get the help of this command displayed in UltraEdit for studying.


There is also another method of opening a file after a user tool run in the same instance of UltraEdit. You can run the user tool always from within a macro stored in an automatically loaded macro file or from within a script added to the script list. This gives you the possibility to open the created output file from within the macro or script after the tool execution has finished. UltraEdit waits always for the end of the user tool execution for user tools with DOS program checked. But it is not possible to execute a macro or script by clicking on a symbol on the toolbar. So the macro or script must be executed by hotkey or by double clicking on the macro/script name in the macro/script list. Scripts can be also executed from the Scripting menu.
This is how it ends:

Code: Select all
@echo off
set EclipseFile=%~1
set EclipseDATA=%~n1
set EclipseMSG=%~n1.MSG
set UEPath=%UEHELPATH:~0,-3%exe
title Eclipse: %EclipseDATA%
echo Schlumberger Eclipse
echo.
echo DATA: %EclipseDATA%
echo.
echo PATH: %EclipseFile%
echo.
echo.
echo.
C:\ecl\macros\eclrun.exe eclipse "%EclipseFile%"
echo.
echo.
echo.
echo DATA: %EclipseDATA%
echo.
echo PATH: %EclipseFile%
"%UEPath%" "%EclipseMSG%"
set EclipseFile=
set EclipseDATA=
set EclipseMSG=
set UEPath=

Thanks!
UltraEdit 16.30.0.1003
UltraCompare Professional 7.20.0.1009
Windows Vista Enterprise, 64 bits, Spanish
5 posts Page 1 of 1
cron