Activate OS Command on Win Server 2008

Author: (Sandipp)


I have the following code in a form.

activate "OS".command("cmd.exe /c dir/O:D/B c:\ > c:\check.txt")

 However, i can see the cmd.exe running in task manager.

Has anyone had the same problem, any help will be much appricated 

Rgds, Sandip

When this is run on Window Server 2008. The application exits immediatley without any errors. And the OS command is not executed.


  1. Hi,

    cmd.exe /c start %%PCmd


    If you use Uniface 9, you have some functions for the manipulation of files


    and if it's also necessary, you can create a component where the operation is like

    operation comandeOS
        String  PCmd   : IN  ; Commande OS à exécuter
        Boolean POut   : IN  ; Nécéssiter d'obtenir le résultat de la commande OS
        Boolean PSync  : IN  ; Synchrone ou non
        Boolean PShell : IN  ; Nécessité de lancer le shell en plus de la commande fournie
        String  PRes   : OUT ; Résultat de la commande OS si besoin
        if (PShell = "T")
            PCmd = "cmd.exe /c start %%PCmd"
        if (POut = "T")
            if (PSync = "T")
                activate/sync "cx0ossx".commandout(PCmd, PRes)
                activate/async "cx0ossx".commandout(PCmd, PRes)
            if (PSync = "T")
                activate/sync "cx0ossx".command(PCmd)
                activate/async "cx0ossx".command(PCmd)
    end ; comandeOS



    Author: apicaud (
  2. I suspect you have a signature "OS" which points at a 32 bit program, and the 2008 is a 64 bit. Have you looked at "spawn" instead?

    Author: Iain Sharp (
  3. Hi Sandip, Still a problem? Or did you fix it? Do you run uniface.exe (desktop) or urouter.exe (server)? Perhaps it has something to do with rights. Does the user has rights to start the cmd? Or write to c:\? As far as I know a regular user can not do something with or in c:\. Please check this. You could try 'cmd /K'. This will leave you with a doscommand box. This might help you find the error. cmd.exe /K dir/O:D/B c:\ > c:\check.txt Also you could try to catch the error of the dos command. THis helped me a lot. Just add '2> file' to your command. Make sure you can write in c: :) cmd.exe /K dir/O:D/B c:\ > c:\check.txt 2> c:\error.txt THis wil create a error.txt with the error message in it. Better use another directory, is there a d:? Or use a c:\temp Succes! Peter

    Author: lammersma (