Unusual spawn error

Author: gianni.sandigliano@unifacesolutions.com (gianni)

Hi all, I am facing with an unusual error after a spawn instruction: spawn "quadratura.csv" is giving back $procerror = -1124 meaning "Application name not valid.". Expectation is the application associated with .csv extension (Excel) should open this file. If I try to: - double click on file quadratura.csv from windows explorer, Excel is opening the file as expected - if I open a command prompt and either type the full path name or go to directory where the file is saved and type the file name without a path, Excel is opening the file as expected - if I open run... and select file quadratura. csv, Excel is opening the file as expected I cannot focus on any reason because only the Uniface application is not able to execute its spawn command, opening this file with Excel on this server... It should be considered the same application is regularly working on any other server at same company site. Any hint on how to solve this issue? Gianni

10 Comments

  1. Hi Gianni, Uniface will try to determine the program that is associated with a specific file extension by querying the registry. When I check this on my machine then Uniface will get the required info for .csv files from the following registry key: > HKEY_CLASSES_ROOT\Excel.CSV\shell\Open\command And the default value of that key is on my machine: > "C:\Program Files\Microsoft Office\Root\Office16\EXCEL.EXE" /dde You can check with a utility like Process Monitor from Windows Sysinternals which registry keys are read on the specific server, where the spawn fails. Maybe that will give you a clue, why the error -1124 "Application name not valid" is thrown. Hope this helps. Daniel


    Author: diseli (daniel.iseli@uniface.com)
  2. Hi Daniel, Thanks for your input... I've digged a little bit more: - Windows is 64bit while Uniface is 32bit, so WOW (Windows on Windows) is up 'n running... - There are more MS Office installations on this specific machine (Excel 10, 12, 14)... - Uniface version is U9.4 something... Still is unbelievable to me why only the Uniface application is showing such hiccup... I am now in the process to compare same Uniface application on a working server as well as on the culprit one using "Process Monitor", as you suggested. I'll let you know... Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  3. Hi Gianni, Thanks for the additional info. I'm not sure if installing different office versions on the same machine is such a good idea. It seems to be possible, but Microsoft admits that this might cause problems and it's not supported systems that have Remote Desktop enabled (for details see here). And maybe the following will work on the "troubled" server in question:

    spawn "cmd.exe /c quadratura.csv" Hope this helps. Daniel


    Author: diseli (daniel.iseli@uniface.com)
  4. Hi Daniel, Uniface version is 9.6.04.X401. The Uniface application behaviour monitored with Process Monitor in the error area is the following: The CORRECT one:

    HKCR\Wow6432Node\.csv
    HKCR\Wow6432Node\Excel.CSV
    HKCR\Wow6432Node\Excel.CSV\shell\Open
    C:\Program
    C:\Program.exe
    C:\Program Files\Microsoft
    C:\Program Files\Microsoft.exe
    C:\Program Files\Microsoft Office\Office16\EXCEL.EXE

    while the WRONG ONE:

    HKCR\Wow6432Node\.CSV
    HKCR\Wow6432Node\Excel.CSV
    HKCR\Wow6432Node\Excel.CSV\shell\Open
    D:\Program
    D:\Program
    D:\Program
    D:\Program
    D:\Program
    D:\Program
    D:\Program
    D:\Program

    It seems to me something is going wrong when Uniface runtime is trying to identify the application associated with .CSV extension. I have the whole Process Monitor log available for both session...could it be of any help to you? Should I open a case with support to continue to dig about this situation? Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  5. Hi Gianni, The spawn command has been officially declared deprecated / obsolete per this documentation. Please also see this topic, which should look familiar to youCool. The alternative would be to create a signature and select the implementation type of “Operating System Command”. When done you will have two operations COMMAND and COMMANDOUT which can be used to supply the command and get the results back, as per this topic. You even can specify a path that directs the operating system component to the operating system server, as per this documentation. In the past I have also use a signature connecting to the ShellExecuteA of the Windows API as per this topic. If you'd want to hold on to the spawn command, this topic also contains some info. Hope this helps, Arjen


    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
  6. Arjen van Vliet said Hi Gianni, The spawn command has been officially declared deprecated / obsolete per this documentation. Please also see this topic, which should look familiar to youCool.

    That's not correct (anymore). With version 9.6.08 this statement has been removed from the doc. For details see Uniface 9.6: Documentation Updates for Patches: > Issue number: 31069 - The spawn command is no longer deprecated. There are no plans to remove this from Uniface. Hope this helps. Daniel


    Author: diseli (daniel.iseli@uniface.com)
  7. Hi Gianni, Thanks for the additional info. Unfortunately we don't see what the default value of HKCR\Wow6432Node\Excel.CSV\shell\Open is. Have you checked that it is the same on both systems? In the meantime I had a quick look at what the spawn statement is doing and the events (from the Process Monitor log) you are mentioning are caused by the Windows function FindExecutable. And this also includes the file I/O following "C:\Program" (respectively "D:\Program"). So, I'm (currently) not sure what's going on here, but this does not seem to be something that the Unfiace runtime is doing (maybe call it a Windows "feature"). But Arjen is right, there are many workarounds for this problem (I've also mentioned one in my post from today at 10:07 am). Hope this helps. Daniel


    Author: diseli (daniel.iseli@uniface.com)
  8. Free translation from an old saying: "It's Uniface's prerogative to change its mind". For a while I was in doubt on the exact status of the spawn command. Nice to know this now, thanksWink.


    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
  9. diseli said
    Arjen van Vliet said Hi Gianni, The spawn command has been officially declared deprecated / obsolete per this documentation. Please also see this topic, which should look familiar to youCool.
    That's not correct (anymore). With version 9.6.08 this statement has been removed from the doc. For details see Uniface 9.6: Documentation Updates for Patches: > Issue number: 31069 - The spawn command is no longer deprecated. There are no plans to remove this from Uniface. Hope this helps. Daniel  

    Free translation from an old saying: “It’s a software company's prerogative to change its mind”. For a while I was in doubt on the exact status of the spawn command. Nice to know this now, thanksWink.

     

    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
  10. As Daniel mentioned above, we also use the way with "cmd" :   variables string V_KOMMA endvariables   V_KOMMA='"' if ( DATEINAME.ANHAENGE != "" ) spawn "cmd /c %%V_KOMMA%%DATEINAME.ANHAENGE%%V_KOMMA" endif  


    Author: Lauterbach (norbert.lauterbach@infraserv.com)