RUN > NUL Command Suppresses Output from MS-DOS Commands

ID: Q90034

The information in this article applies to:

SUMMARY

You can execute an MS-DOS command from the FoxPro Command window by using the RUN command. Any messages that the command writes appear on the screen. To suppress this output, use the following syntax in the Command window:

   RUN > NUL <MS-DOS command>

If the MS-DOS command executes successfully, no output appears on the screen. Otherwise, an MS-DOS error message appears.

Alternatively, you can send the output of the MS-DOS command to a file, and use the NULL command to suppress the output from the screen. For example:

   !DIR *.EXE > FILENAME.EXT < NULL

   -or-

   RUN DIR *.EXE > FILENAME.EXT < NULL

NOTE: The following command

   !NET USE \\PATH\PATH

displays the message "Command completed successfully" or an error message if the command did not execute successfully. If you change the command to

   !NET USE \\PATH\PATH > NUL

the error message is suppressed.

MORE INFORMATION

For example, the following command copies all files with the .DBF extension in the current directory to the floppy disk in drive A without displaying any message if the copy is successful:

   RUN > NUL COPY *.DBF A:

If the floppy disk does not have enough space to hold the files, an "Insufficient disk space" message appears on the screen.

Additional reference words: FoxDos 2.00 2.50 2.50a background turn off KBCategory: kbprg KBSubcategory:

Last Reviewed: April 17, 1995