You are currently offline, waiting for your internet to reconnect

SHELL Redirected to NUL Device Suppresses MS-DOS Message

This article was previously published under Q40592
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
SUMMARY
From a Basic program, you can invoke the SHELL statement to execute anMS-DOS command. Normally, many MS-DOS commands give you a confirmationmessage. If you want to suppress the message (thus making the SHELLoperation less visible), you can redirect the standard MS-DOS outputto the NUL device.

Here is an example:
   SHELL "copy file1 file2 > NUL"				
The above statement copies file1 to file2 and redirects the successreport "1 file(s) copied" to the NUL device, which is never displayed.You may do the same redirection to prevent the DOS success report fromprinting on the printer (PRN) device:
   SHELL "copy file1 PRN > NUL"				
MORE INFORMATION
The above information applies to the following products:

  1. Microsoft QuickBasic versions 2.00, 2.01, 3.00, 4.00, 4.00b, and 4.50 for the IBM PC
  2. Microsoft Basic Compiler versions 6.00 and 6.00b for MS OS/2 and MS-DOS
  3. Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS and MS OS/2
  4. Microsoft GW-Basic Interpreter versions 3.20, 3.22, and 3.23 for MS-DOS
In MS-DOS, the greater-than sign, ">", redirects standard output tostandard input. The less-than sign, "<", redirects standard input tostandard output.
QuickBas BasicCom
Properties

Article ID: 40592 - Last Review: 08/16/2005 21:25:25 - Revision: 2.1

Microsoft BASIC Compiler 6.0, Microsoft BASIC Compiler 6.0b, Microsoft QuickBasic 4.0, Microsoft QuickBASIC 4.0b, Microsoft QuickBasic 4.5 for MS-DOS, Microsoft BASIC Professional Development System 7.0, Microsoft BASIC Professional Development System 7.1, Microsoft GW-BASIC 3.2, Microsoft GW-BASIC 3.22, Microsoft GW-BASIC 3.23

  • KB40592
Feedback
body>f?DI=4050&did=1&t=">