The use of masking error messages nul 2>nul in batches (Cmd>nul space 2>nul) _dos/bat

Source: Internet
Author: User
Del Abc.txt>nul 2>nul
This ">nul 2>nul" can mask the output of all the screens can be understood as follows:

If a command is executed, but do not want to see the implementation of this command on the screen, you can use "[Command]>nul" can mask the command on the screen output, but some command execution error, that is, the use of ">nul" also can not mask the information generated by the command, so just add "2 >nul "This, is" [command]>nul+ space +2>nul), so that regardless of whether the command is properly run, it will not be seen on the screen of this command produced by the screen display.
Use the "dir" command to display a list of files and folders for the current directory. At this point, if you use "Dir>nul", the dir command does not see the screen output, then type "Dirr" will show "' Dirr ' is not an internal command, nor an external command, nor a batch file." ", then If you use" Dirr>nul "to block this error, because still will appear" ' Dirr ' is not an internal command, nor an external command, nor a batch file. " "This error prompt, if use" Dirr>nul 2>nul "then, on the screen can not see the above error prompt

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.