UltraEdit v27.xx does not recognize anymore an unquoted file name with a space on command line as one argument string

UltraEdit v27.xx does not recognize anymore an unquoted file name with a space on command line as one argument string

4
NewbieNewbie
4

    Oct 07, 2020#1

    Hello,

    I have the problem with UltraEdit v27 that no spaces are recognized in folder names. The program cuts off the folder name at the first space and then can no longer find the file. I have made two screenshots for clarification – 01.jpg made with UE version 27.10.0.108 and 02.jpg made with UE version 26.20.0.68. I am using now again version 26.20.

    Kind regards, Peter


    01.jpg (45.74KiB)
    02.jpg (60.09KiB)

    6,688586
    Grand MasterGrand Master
    6,688586

      Oct 08, 2020#2

      Hi Peter!

      Do you use Total Commander?

      Is configured to use as editor ueFastStart.exe in settings of Total Commander?

      Do you use F4 or Shift+F4 in Total Commander to open a file with ueFastStart.exe in UltraEdit?

      If the three questions are answered three times with yes and UltraEdit v27.xx is not already running, than there is indeed a problem caused by how ueFastStart.exe is starting UltraEdit with the name of the file to open specified on the command line as I could find out with Sysinternals Process Explorer.

      ueFastStart.exe starts the UltraEdit executable with the file name not enclosed in double quotes as it must be done on file name containing a space or an ampersand or an equal sign.

      ueFastStart.exe starts UltraEdit for example with the command line:

      "C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\uedit32.exe" G:\01\014_IDM\01-U-Edit\Mal sehen\perlcgi.txt

      UltraEdit versions prior version 27.00 find out by itself that there are not to open the two files G:\01\014_IDM\01-U-Edit\Mal and sehen\perlcgi.txt, but the file G:\01\014_IDM\01-U-Edit\Mal sehen\perlcgi.txt.

      But UltraEdit v27.xx parses the command line arguments different because of the additional feature to get the hash value for a file from command line (with the help of uedit32.com or uedit64.com). See also Command line parameter -f does no longer work with UE v27.00 on search string containing space (fixed).

      UltraEdit for Windows v27.xx is not anymore as fault tolerant as former versions regarding to file names with spaces not enclosed in double quotes.

      ueFastStart.exe should use the following command line to start UltraEdit and open the example file:

      "C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\uedit32.exe" "G:\01\014_IDM\01-U-Edit\Mal sehen\perlcgi.txt"

      That is the command line used by Total Commander if uedit32.exe is configured as editor in settings of Total Commander instead of ueFastStart.exe.

      It also does not work anymore to start UltraEdit by ueFastStart.exe and open multiple files of which full qualified file names are written line by line by ueFastStart.exe into a temporary list file created in %TEMP% and starting UltraEdit with the command line:

      "C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\uedit32.exe" /f%TEMP%\CMD265E.tmp

      UltraEdit v27.00 and later versions require now a space between option /f and the full name of the list file which should be additionally always enclosed in double quotes as the path to folder for temporary files can contain a space character. So ueFastStart.exe should use in this case:

      "C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\uedit32.exe" /f "%TEMP%\CMD265E.tmp"

      Note: ueFastStart.exe does not really start UltraEdit with %TEMP%. ueFastStart.exe uses the real full path to folder for temporary files.

      The space character between /f and list file name was prior v27.00 optional, but is required now.

      Opening files using ueFastStart.exe works still fine on UltraEdit 27.xx already running as in this case the file name(s) are passed to UltraEdit using the message sent also by Windows to UltraEdit on drag and drop one or more file names to UltraEdit's main application window.

      Windows File Explorer and Total Commander itself start UltraEdit with the file name of the file to open always enclosed in double quotes. So this issue occurs only with ueFastStart.exe used from Total Commander as done by me for many years now or from Windows File Explorer.

      In case of ueFastStart.exe is not used by you, but UltraEdit is started from another application or a script with the full qualified file name of the file to open specified on the command line, make sure that the file name is always enclosed in double quotes, even on not containing a space or & or =.
      Best regards from an UC/UE/UES for Windows user from Austria

      4
      NewbieNewbie
      4

        Oct 10, 2020#3

        Hello Mofi,

        First of all thank you for the detailed answer.  I use Speed Commander. I'm currently using UltraEdit v26, but I opened the file also with UE v27 with Windows Explorer. There was the same problem.

        6,688586
        Grand MasterGrand Master
        6,688586

          Oct 11, 2020#4

          I could not see an issue with right clicking in Windows File Explorer of Windows 7 on a file and clicking in context menu on item UltraEdit to open the file with 32-bit UltraEdit v27.10.0.108 whereby no instance of UltraEdit was running on making these two mouse clicks. I could see in Sysinternals Process Explorer that Windows File Explorer started UltraEdit executable via shell integration DLL of UltraEdit by running uedit32.exe with full path enclosed in double quotes with full qualified file name of the file also in double quotes. The file name of the file to open contained in my test a space in file path as well as in file name. So UltraEdit was started with:

          "C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\uedit32.exe" "C:\Temp\Test Folder\Test & File.txt"

          Then I unchecked the Explorer integration in configuration of UltraEdit v27.10.0.108, exited UltraEdit and right clicked on a file in Windows File Explorer to open the context menu again. The context menu did not contain anymore the menu item UltraEdit. So I opened submenu Open with and clicked on item UltraEdit Professional Text/Hex Editor. That worked again fine. Windows File Explorer started UltraEdit again with:

          "C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\uedit32.exe" "C:\Temp\Test Folder\Test & File.txt"

          Do you double click on the file in Speed Commander or Windows File Explorer?

          Yes, then the file extension is associated with UltraEdit, but the file association is not done correct.

          Please open a command prompt window and run first the command line:

          reg query HKCR\.uem /ve

          The output was:

          Code: Select all

          HKEY_CLASSES_ROOT\.uem
               (Default)   REG_SZ    uem_auto_file
          .uem is the file extension of the file which is opened by you with a double click, for example .txt or .uem as I used for testing. The file extension .uem was by default not associated with any application. So Windows File Explorer asked me on first double click on the file with extension .uem which application I want to use to open this file and I selected UltraEdit.

          The string at end of second line is important for the next command line to run in command prompt window which is:

          reg query "HKCR\uem_auto_file\shell\open\command" /ve

          This line should output the command line used by Windows File Explorer or any other application on double a clicking the file. In my test case was output:

          Code: Select all

          HKEY_CLASSES_ROOT\uem_auto_file\shell\open\command
               (Default)    REG_SZ    "C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\uedit32.exe" "%1"
          The four " are important. The default value must contain %1 enclosed in " to work for any file name with any file path.

          There are by default files associated with an application with just %1 instead of "%1".

          Example:

          reg query HKCR\.txt /ve

          Code: Select all

          HKEY_CLASSES_ROOT\.txt
               (Default)   REG_SZ    txtfile
          reg query "HKCR\txtfile\shell\open\command" /ve

          Code: Select all

          HKEY_CLASSES_ROOT\txtfile\shell\open\command
               (Default)    REG_EXPAND_SZ    %SystemRoot%\system32\notepad.exe %1
          The difference in registry value type does not matter. The application must interpret all argument strings in this case as one file name. The command line above results in starting Notepad for example with the command line:

          "C:\Windows\system32\notepad.exe" C:\Temp\Test Folder\Test & File.txt

          Notepad must interpret C:\Temp\Test Folder\Test & File.txt as one file name argument string and Notepad does that.

          However, all shell open commands should contain "%1" and not just %1 in default string value of type REG_SZ or REG_EXPAND_SZ to work for all applications including those supporting multiple options or multiple file names like UltraEdit.
          Best regards from an UC/UE/UES for Windows user from Austria

          4
          NewbieNewbie
          4

            Oct 11, 2020#5

            I open the text file with a left click in Speed Commander. I use Windows 10 64-bit and also UE 64-bit.

            The entry "HKEY_CLASSES_ROOT\txtfile\shell\open\command" does not exist for me. I had once rewritten the shell open command in the Windows registry from Notepad.exe to D:\Programs\UltraEdit\uedit64.exe %1 and this for all file formats opened with Notepad. I had already introduced this in XP times. (Now adapted to Windows 10 of course). I will install UE 27 and look on what happens on opening it via context menu in the next days and get back to you.

            Thank you very much.

            6,688586
            Grand MasterGrand Master
            6,688586

              Oct 12, 2020#6

              Okay, the reason for the issue is found and is easy to fix.

              Start Windows registry editor, search in HKEY_CLASSES_ROOT for uedit64.exe %1 and modify each found string to uedit64.exe "%1". That's it.

              The double quotes around %1 would be better also for UltraEdit v26.20. UltraEdit v27.20 requires the double quotes around the file name passed via command line argument to UltraEdit.
              Best regards from an UC/UE/UES for Windows user from Austria

              4
              NewbieNewbie
              4

                Oct 12, 2020#7

                aaaargh. It was. Thank you. Put the corresponding %1 in double quotes, restart the computer and now it works.
                Peter