OS/2, eCS & ArcaOS - Technical > Programming

Rexx close cmd.exe

(1/1)

Per E. Johannessen:
Hi,

I'm running this from a VX-Rexx program;

address cmd "start D:\GS\GS9.15\BIN\gsos2 -dQUIET -sDEVICE=pdfwrite -o d:\PDF\modified.pdf d:\PDF\source.ps -f d:\PDF\source.pdf"

and it brings up a cmd window that remain open after the script has finished.

Would prefer not to see that cmd window at all or at least get it closed automatically.
Have searched without finding what I need so I hope I have not overlooked the obvious :)

Suggestions?

Andreas Schnellbacher:
Add /c to cmd.exe and /min to start. See:


--- Code: ---start view cmdref cmd
start view cmdref start
--- End code ---

What should also work is to remove the leading 'address cmd'. Then the default COMSPEC is used to execute an enquoted line, either single or double quotes:


--- Code: ---'start /min D:\GS\GS9.15\BIN\gsos2 -dQUIET -sDEVICE=pdfwrite -o d:\PDF\modified.pdf d:\PDF\source.ps -f d:\PDF\source.pdf'

--- End code ---

This starts an asynchronous process. To start a synchronous process, use 'call'. In many cases also 'call' can be omitted. Note that cmd's call is different from the REXX call statement:


--- Code: ---'call D:\GS\GS9.15\BIN\gsos2 -dQUIET -sDEVICE=pdfwrite -o d:\PDF\modified.pdf d:\PDF\source.ps -f d:\PDF\source.pdf'
--- End code ---

Per E. Johannessen:
Had already tried with cmd /c but that results in "invalid expression".
Thanks for pointing me to "start view cmdref start", I now added /c /min to start and it works.

Navigation

[0] Message Index

Go to full version