Kbase P143179: How to launch MS Windows batch script as a separate process from an OpenEdge session
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  26/05/2009 |
|
Status: Unverified
GOAL:
How to launch MS Windows batch script as a separate process from an OpenEdge session
GOAL:
How to launch batch script as a separate process, not waiting on its execution to finish and not displaying DOS console window
GOAL:
How to start batch script without displaying console window
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
Windows
FIX:
Create an ABL procedure with the following content :
/* runbatch.p */
DEFINE VARIABLE cLine as CHARACTER NO-UNDO.
cLine = "wscript.exe ~"C:\progwrk\runbatch.vbs~" ~"C:\progwrk\mybatch.bat~"" .
OS-COMMAND NO-WAIT VALUE(cLine) .
Create file runbatch.vbs and put the following line :
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0,False
Running the procedure runbatch.p will launch C:\progwrk\mybatch.bat in a separate process without displaying console window.
In this case it doesn't matter whether NO-WAIT, SILENT or NO-CONSOLE options are being used with OS-COMMAND statement.
Batch command will launch in a separate process, without DOS console window and execution immediately returned to the ABL procedure.
However, it is important that the execution of the batch script doesn't require any user input and that all errors are handled
without user intervention, or the process will remain running blocked waiting for user interaction.