You can specify a file name or another existing handle.To specify redirection to existing handles, use the ampersand (&) character followed by the handle number that you want to redirect (that is, &&1 When you duplicate a handle, you duplicate all characteristics of the original occurrence of the handle.Almost all commands send output to your Command Prompt window.Even commands that send output to a drive or printer display messages and prompts in the Command Prompt window.The sort command uses the dir command's output as its input, and then sends its output to handle 1 (that is, STDOUT).You can create custom commands by combining filter commands with other commands and file names.By default, you send the command input (that is, the STDIN handle) from your keyboard to Cmd.exe, and then sends the command output (that is, the STDOUT handle) to the Command Prompt window. The numbers zero through nine (that is, 0-9) represent the first 10 handles.You can use to run a program and redirect any of the first 10 handles for the program.
If you do not define a handle, the default operator, you must specify where you want to read or write the data.This will not work in older DOS versions or in OS/2 Warp's DOS box, though, since FIND won't return errorlevels in those DOS versions. COM), the environment size in bytes (/E:512), and finally the /P parameter makes the primary command interpreter permanent (without the /P parameter, it would be possible to remove the primary command interpreter from memory by using the EXIT command, thus leaving the operating system without command interpreter without the means to reload it).The following batch file @ECHO OFF :: DRIVERea DY — Check if drive A: is ready :: Written by Rob van der Woude :: Dependencies: Needs MS-DOS 6 or up, or OS/2 Warp 4 :: May or may not work on earlier OS versions, :: that hasn't been tested yet :: :: Set initial value SET AREADY= :: Clean up old temporary files IF EXIST DRIVERDY. You may add any parameter that is valid for the specified command interpreter.One way to get rid of the error message could be to nest several batch files.If you would call the batch file above with: However, CTTY is not a standard part of "modern" Microsoft operating systems anymore, whereas COMMAND. It is not possible to replace COMMAND with %COMSPEC%, since this trick will not work with other command processors than COMMAND. The example shown above depends on MS-DOS 6's FIND returning an errorlevel if it doesn't find the specified string. TMP :: Check if drive A: is ready, redirect error message to temporary :: file, /F parameter automates "Fail" on Abort, Retry, Fail prompt COMMAND. SYS the SHELL command is used to specify the primary command processor (C:\DOS\COMMAND. COM (C:\DOS, needed to reload the "transient" part of COMMAND.