OS-COMMAND with NO-WAIT and NO-CONSOLE used together

shyl

New Member
Hi all,
My question is that, when using OS-COMMAND, it seems to me that the if the NO-WAIT & NO-CONSOLE arg are used together, it simply cannot work.

The example I used to verify this is that: code segment as

if opsys="win32" then
os-command no-console no-wait value('xcopy d:\temp\abc\*.* d:\temp\def\*.* /Y /E').


will not work. However, it just can work well, either without no-console or without no-wait. (Tested under PROGRESS 9.1D)

What I actually want is to initiate the xcopy ASYNCHRONOUSLY, without my PROGRESS process waiting it to finish. Nor do I want to see a black command shell being prompted. Please tell me I've used it in the wrong way.

Cheers,
shyl
 

sphipp

Member
You can't use SILENT and NO-WAIT together, but NO-WAIT and NO-CONSOLE are fine.

E.g.

Code:
os-command silent no-console value ("dir > dir.lst").
display search ("dir.lst") form "x(50)"
works a treat.
 

D.Cook

New Member
I've also been trying to achieve this and have the same problem. It appears to be a bug, as it does not behave as described in the documentation (I'm trying with 10.1C).

I tried using 'start' with the /B switch but unfortunately it doesn't behave quite how I hoped.
Eg:
Code:
os-command no-wait /*no-console*/ value("start /B cmd").
A compromise could be to use the /MIN switch which minimises the command window, however this won't cut it for me as I'm trying to start a process that will run for a long time.
Eg:
Code:
os-command no-wait /*no-console*/ value("start /MIN cmd").
 

erickroco9611

New Member
ID: P99641
Title: "OS-COMMAND NO-WAIT does not execute the command specified"
Created: 01/05/2005Last Modified: 03/24/2005Status: Unverified


Symptoms:
OS-COMMAND NO-WAIT does not execute the command specified
Command executes fine without NO-WAIT option


Facts:
Windows NT 32 Intel/Windows 2000


Cause:
COMSPEC environment variable set to the wrong executable


Fixes:
Set the COMSPEC environment variable to the appropriate executable, by default on most Windows systems the executable is %WINDIR%\SYSTEM32\CMD.EXE.

Notes:
References to Written Documentation:

Progress Solution:

P74539, "How to call a GUI Session from a CHUI Session"ID: P99641
Title: "OS-COMMAND NO-WAIT does not execute the command specified"
Created: 01/05/2005Last Modified: 03/24/2005Status: Unverified


Symptoms:
OS-COMMAND NO-WAIT does not execute the command specified
Command executes fine without NO-WAIT option


Facts:
Windows NT 32 Intel/Windows 2000


Cause:
COMSPEC environment variable set to the wrong executable


Fixes:
Set the COMSPEC environment variable to the appropriate executable, by default on most Windows systems the executable is %WINDIR%\SYSTEM32\CMD.EXE.

Notes:
References to Written Documentation:

Progress Solution:

P74539, "How to call a GUI Session from a CHUI Session"
ID: P99641
Title: "OS-COMMAND NO-WAIT does not execute the command specified"
Created: 01/05/2005Last Modified: 03/24/2005Status: Unverified


Symptoms:
OS-COMMAND NO-WAIT does not execute the command specified
Command executes fine without NO-WAIT option


Facts:
Windows NT 32 Intel/Windows 2000


Cause:
COMSPEC environment variable set to the wrong executable


Fixes:
Set the COMSPEC environment variable to the appropriate executable, by default on most Windows systems the executable is %WINDIR%\SYSTEM32\CMD.EXE.

Notes:
References to Written Documentation:

Progress Solution:
ID: P99641
Title: "OS-COMMAND NO-WAIT does not execute the command specified"

Created: 01/05/2005 Last Modified: 03/24/2005
Status: Unverified



Symptoms:
•OS-COMMAND NO-WAIT does not execute the command specified
•Command executes fine without NO-WAIT option


Facts:
•Windows NT 32 Intel/Windows 2000



Cause:
•COMSPEC environment variable set to the wrong executable


Fixes:
Set the COMSPEC environment variable to the appropriate executable, by default on most Windows systems the executable is %WINDIR%\SYSTEM32\CMD.EXE.


P.D. I still cannot fix in mi Win Vista Home Premium x64.
 

erickroco9611

New Member
Hi..

I did this sample..

c-comando = "%WINDIR%\SYSTEM32\CMD.EXE /MIN /C " + c-archivo-bat.
OS-COMMAND NO-WAIT VALUE(c-comando).
p-enviado = TRUE.
And START ti RUN the .bat File...

But if i set NO-CONSOLE it fails.. DAMN!!!

I hate that BLACK SCREEN!!!
 

dragonsei

New Member
I thought "AT" command (this is used of scheduling jobs) should be more appropriate in this case. But, may have problem in Vista. Anyway, I had not tested it.
 

jkuhns

New Member
Found this problem as well. Here's my workaround:

DEF VAR batFile AS CHAR NO-UNDO.
batFile = OS-GETENV("TEMP") + "\" + someVar + ".bat".
OUTPUT TO VALUE(batFile).
PUT UNFORMATTED commandLineVar.
OUTPUT CLOSE.
OS-COMMAND SILENT VALUE("start /b " + batFile).
 
Top