SHELL Redirected to NUL Device Suppresses MS-DOS Message

Elévült tudásbáziscikk-tartalommal kapcsolatos figyelmeztetés

Ez a cikk olyan termékkel kapcsolatos, amelyhez a Microsoft már nem biztosít támogatást, ezért az „jelen állapotában” érhető el, és a továbbiakban nem fog frissülni.

Summary

From a Basic program, you can invoke the SHELL statement to execute an MS-DOS command. Normally, many MS-DOS commands give you a confirmation message. If you want to suppress the message (thus making the SHELL operation less visible), you can redirect the standard MS-DOS output to the NUL device.


Here is an example:
   SHELL "copy file1 file2 > NUL"
The above statement copies file1 to file2 and redirects the success report "1 file(s) copied" to the NUL device, which is never displayed. You may do the same redirection to prevent the DOS success report from printing 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 to standard input. The less-than sign, "<", redirects standard input to standard output.
Tulajdonságok

Cikkazonosító: 40592 - Utolsó ellenőrzés: 2005. aug. 16. - Verziószám: 1

Visszajelzés