Search code examples
macrosexeultraedit

Is it possible to convert the epsilon or UltraEdit macro to exe?


If anyone know about how to convert the epsilon and UltraEdit macros to exe.

Could you please?


Solution

  • An UltraEdit macro can't be converted into an executable. The UltraEdit macro commands can be executed only by UltraEdit.

    But it is possible to run an UltraEdit macro from within a batch file using UltraEdit to automate file reformatting tasks using an UE macro.

    Here is a commented example for such a batch file:

    @echo off
    rem Get name of UltraEdit executable with full path from Windows registry.
    set "UltraEditEXE="
    call :GetFileNameUE "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\uedit32.exe"
    if not "%UltraEditEXE%" == "" goto RunMacro
    call :GetFileNameUE "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\uedit64.exe"
    if not "%UltraEditEXE%" == "" goto RunMacro
    call :GetFileNameUE "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\uedit32.exe"
    if not "%UltraEditEXE%" == "" goto RunMacro
    call :GetFileNameUE "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\uedit64.exe"
    if not "%UltraEditEXE%" == "" goto RunMacro
    echo UltraEdit is not installed most likely as no uedit*.exe found.
    echo.
    pause
    goto :EOF
    
    rem Run UltraEdit using Windows command start to run UE minimized with forcing
    rem always an new instance of UltraEdit, opening a file and processing this
    rem file with an UltraEdit macro. This instance of UltraEdit is automatically
    rem exited after macro executed once on the opened file. The macro must save
    rem the file before exiting. While UltraEdit is running the batch procssing
    rem is continued with deleting the environment variable and then exiting
    rem batch processing. See in help of UltraEdit the page with title "Command
    rem Line Parameters" for details on the used UE command line parameters.
    
    :RunMacro
    start "Run UE macro" /min "%UltraEditEXE%" /fni "Path\Name of file to modify.txt" /M,E,1="Macro file with full path/Macro Name"
    set "UltraEditEXE="
    goto :EOF
    
    rem This is a subroutine called up to 4 times to determine name of UltraEdit
    rem executable with full path from Windows registry if UltraEdit is installed
    rem at all. It assigns file name of UltraEdit with full path and with file
    rem extension to environment variable UltraEditEXE on success finding the
    rem registry value in registry key passed as parameter to this subroutine.
    
    :GetFileNameUE
    for /F "skip=2 tokens=3*" %%A in ('%SystemRoot%\System32\reg.exe QUERY %1 /ve 2^>nul') do (
        if "%%A" == "REG_SZ" set "UltraEditEXE=%%B" & goto :EOF
    )
    goto :EOF
    

    For understanding the used commands and how they work, open a command prompt window, execute there the following commands, and read entirely all help pages displayed for each command very carefully.

    • call /?
    • echo /?
    • for /?
    • goto /?
    • if /?
    • pause /?
    • reg query /?
    • rem /?
    • set /?
    • start /?