run a DOS command without the cmd window opening
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
1-614-875-2245
*********************************************************************
—–Original Message—–
From: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] On Behalf Of rab tab
Sent: Wednesday, January 17, 2018 2:45 PM
To: OmnisDev List – English <omnisdev-en@lists.omnis-dev.com>
Subject: run a DOS command without the cmd window opening
Hi,
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 lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com