Hello Przemek,
Thanks for helping. It makes clear to me how to use hb_ProcessRun().
But... it still opens the mentioned command prompt window (although for
a fraction of a second).
The only way to avoid that is doing as the code below. Please correct me
if I am wrong...
The problem with that is that it is a Windows only solution.
Regards,
Qatan
------8<-----
// Compile with hbmk2 tst -gui -lhbwin
// For this example you need to have
ANNOUNCE HB_GTSYS
REQUEST HB_GT_NUL_DEFAULT
PROCEDURE Main()
LOCAL cCommand := 'start tst.txt'
LOCAL cFile := 'tst.txt'
// hb_Run( 'start .' )
// hb_processRun( getEnv( "COMSPEC" ) + " /c " + cCommand )
MyRun( '"START "" /MIN "' + cFile + '"' )
RETURN
FUNCTION MyRun( cCommand, lFlag )
LOCAL oShell, nErrorlevel
hb_Default( @lFlag, .F. )
oShell := WIN_OleCreateObject( "WScript.Shell" )
nErrorlevel := oShell:RUN( GETENV( "COMSPEC" ) + " /c " + cCommand, 0,
lFlag )
// nErrorlevel := oShell:RUN( "%COMSPEC% /c " + cCommand, 0, lFlag ) //
Optional way
oShell := NIL
RETURN IF( nErrorlevel = 0, .T., .F. )
------>8------