SHELL Redirected to NUL Device Suppresses MS-DOS Message (40592)
The information in this article applies to:
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1
- Microsoft GW-BASIC 3.2
- Microsoft GW-BASIC 3.22
- Microsoft GW-BASIC 3.23
This article was previously published under Q40592 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"
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB40592 |
---|
|