spawn on newer windows OS.

Author: (Iain Sharp)

Has anyone else had issues with spawn "#oscommand" on newer windows OS (Windows 7, Windows server 2008)

We appear to be getting failures on trying to execute commands which work correctly from the command line for the same user.

In one case I was able to successfully replace the spawn with an activate on an OS Command signature SVC.Commandout(oscommand,results) but in the other case I need the program to be run interactively, and whilst is successfully runs from the activate, interactive responses cause the system to lock up. I cannot debug on the machine with the problem (the debugger crashes).

We are going to uninstall and re-install uniface and our App from the windows 7 machine, and see if that helps, but if anyone has any experience of permissions or group policies which need to be set, that would be lovely.


  1. Hi, it is a while ago but did you manage to figure it out? I'm trying a spawn on Win7: spawn "reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices" > c:\temp\printer.txt" This is not working. When i do reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices" > c:\temp\printer.txt in a dos-box i reeive the correct data. Did the re-install work? Thanks Anne

    Author: anne_vw (
  2. No, I don't think we did figure it out. I can possibly help you with that particular issue though. 1. I have a signature for the windows shell dll and a global proc which looks up registry entries. I can export them and let you have them if you'd like. 2. There is a new feature, not documented until 9.5 but available in 9.3 which allows you to query the registry (amongst others) directly. It's called $setting and allows you to get (and, I think, set) registry entries directly into uniface lists. Iain

    Author: Iain Sharp (
  3. It is a dos vs windows thing. The command is executed under windows but the redirect fails - try forcing it to use the command interpreter. spawn "cmd /c reg query %%"%%%HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices%%"%%% > c:\temp\printer.txt" There is also the a signature that can be created for calling out to the operating system. 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. Mike

    Author: Mike Taylor (
  4. Anne. $setting is the way to go if you want to read registry settings. For the actual spawn problem see Mike's answer. Greetings, Theo

    Author: Theo Neeskens (