DOS statement
- Last Updated: January 18, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
(Windows only)
Runs a program, DOS command, or DOS batch file, or starts the DOS command processor, which allows interactive processing of DOS commands.
Syntax
|
- SILENT
- After processing a
DOSstatement, the AVM shell pauses, and prompts you to press SPACEBAR to continue. When you press SPACEBAR, the AVM clears the window and continues processing. You can use theSILENToption to eliminate this pause. Use this option only if you are sure that the DOS program, command, or batch file will not generate output to the window. - command-token | VALUE ( expression )
- One or more command (command-token)
words and symbols that you want to pass to a DOS command processor. The
VALUEoption generates the command tokens included in expression, a character string expression. The specified combination of command-token andVALUE(expression)options can form any legal combination of commands and command options permitted by the DOS command processor, including programs, DOS commands, and batch files. If you do not use any of these options, theDOSstatement invokes the DOS command processor, which remains until you exit it.
Example
On UNIX, this procedure runs the UNIX ls command. In Windows, this procedure runs the DOS dir command. On other platforms, the AVM displays a message stating that the operating system is unsupported.
r-dos.p
|
Notes
- If you use the
DOSstatement in a procedure and the procedure compiles on a UNIX system, the procedure runs, as long as flow of control does not pass through theDOSstatement while running on UNIX. Use theOPSYSfunction to return the name of the operating system where a procedure is being run. This function lets you write applications that are portable among OpenEdge-supported operating systems even if they use theDOS,UNIX, etc. statements. - When running 32-bit OpenEdge on a 64-bit operating system, if you attempt to use the
DOSstatement to run an executable in the %WINDIR%\System32 directory, execution will fail. To remedy this, you can do one of the following:- Put the files you want to access in the %WINDIR%\SysWOW64 directory.
- Put the files you want to access in another directory and ensure that directory is listed in %PATH%.
- Change your code to use %WINDIR%\Sysnative, to force the operating system to point to %WINDIR%\System32. Note that this can cause problems if the application also runs under a 32-bit version of Windows.
See also
{ } Preprocessor name reference, OPSYS function, UNIX statement