RUN > NUL Command Suppresses Output from MS-DOS Commands

Last reviewed: April 17, 1995
Article ID: Q90034
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a

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:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.