OS-COMMAND quotation handling on Windows (-oscmdwin)
- Last Updated: April 8, 2026
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
On Windows systems, OpenEdge applications can execute external operating system commands by
using the OS-COMMAND statement. The -oscmdwin
startup parameter, available as of OpenEdge 12.8.12, controls how quotation marks in
command strings are handled when the unnamed output stream is redirected.
In a local session, the unnamed output stream is redirected only when an AVM uses
OUTPUT TO or OUTPUT THROUGH statements. In
Progress Application Server (PAS) for OpenEdge sessions, the unnamed output stream
is always redirected.
As a result, quoted command paths or quoted arguments passed to OS-COMMAND
may not be preserved when the unnamed output stream is redirected, depending on the
value of -oscmdwin. This parameter provides control over the
Windows‑specific mechanism used to launch operating system commands and preserve
quotation marks in redirected output scenarios.
| Operating system and syntax | Windows | -oscmdwin n | ||
|---|---|---|---|---|
| Use with | Maximum value | Minimum value | Single-user default | Multi-user default |
| Client Session | 1 | 0 | 0 | 0 |
- n
- An integer specifying how to handle quotations:
- 0 (default)—Specifies that the AVM might remove quotation marks from command
strings when output is redirected. This value preserves behavior
from previous OpenEdge versions.
Use this value for existing applications that already escape quotation marks in command strings.
- 1—Specifies that the AVM might remove quotation marks from command strings when
output is redirected, except in PAS for OpenEdge Web Transport
sessions.
Use this value when porting a Classic WebSpeed application to PAS for OpenEdge. It can also be used for existing local client or PAS for OpenEdge applications that already escape quotation marks in command strings.
- 0 (default)—Specifies that the AVM might remove quotation marks from command
strings when output is redirected. This value preserves behavior
from previous OpenEdge versions.
The following statement passes a quoted command and arguments:
|
If output is redirected with -oscmdwin 0 or -oscmdwin 1, the AVM executes:
|
Without quotation marks, the operating system splits arg1=a into two
parameters (arg1 and a) instead of treating it as
the intended quoted argument "arg1=a".
When running a Web transport session on PAS for OpenEdge with -oscmdwin 1,
the AVM executes:
|
In this case, the quoted argument "arg1=a" is preserved and passed as a
single parameter, as intended.