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.

The following statement passes a quoted command and arguments:

OS-COMMAND SILENT VALUE('""C:\TEMP\test.bat" "arg1=a" "arg2=b""')

If output is redirected with -oscmdwin 0 or -oscmdwin 1, the AVM executes:

C:\TEMP\test.bat arg1=a arg2=b

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:

"C:\TEMP\test.bat" "arg1=a" "arg2=b"

In this case, the quoted argument "arg1=a" is preserved and passed as a single parameter, as intended.