run a DOS command without the cmd window opening

Michael Mantkowski michaelj at
Wed Jan 17 14:49:50 EST 2018

Try something like this.

Register DLL ("Shell32.dll",con('ShellExecute',pick(inU,'A','W')),"JJCCCCJ") Returns lvReturn     ;; Allow for ShellExecute calls
Calculate lvProgram as 'C:\Program.exe'
Calculate lvCommand as '\a \b'
Call DLL ("Shell32.dll",con('ShellExecute',pick(inU,'A','W')),0,"#NULL#",lvProgram,lvCommand,"#NULL#",1) Returns lvErrorCode

Michael Mantkowski
ClienTrax Software

-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at] On Behalf Of rab tab
Sent: Wednesday, January 17, 2018 2:45 PM
To: OmnisDev List - English <omnisdev-en at>
Subject: run a DOS command without the cmd window opening


In the application I’m working on we occasionally interact with postgres via the command line (pg_dumpall, psql…) on both PCs and Macs, so either the BASH shell or DOS cmd.

No issue on Unix, but in Windows the blank black cmd window opens up and sits there until the operation is finished. Sometimes, a confused user will close it, and it messes things up. 

I want to be able to run the DOS command ‘headless,’ ie, without the cmd window opening.

I’ve tried using ‘start’ to minimize the window...
> start /MIN ‘’ … [the rest of my command, which sends stderr output to a file]
which works quite nicely except that then the command does not write output to stderr, which I need.

Played with the /B option as well, but no joy.

Does anyone have a way to accomplish when I need?

Thanks a lot. :-)

Rob Alexander

"Straight ahead and strive for tone." -- Frank Marocco

Manage your list subscriptions at

More information about the omnisdev-en mailing list