Re: xyxFlysky
The ">nul 2>nul" can block all screen output. Here's the understanding:
Suppose you execute a command but don't want to see the execution result on the screen. You can use " >nul" to block the output of the command on the screen. But some commands may produce error messages, and even using ">nul" can't block the information they generate. So adding " 2>nul" after it, that is, " >nul 2>nul", in this way, whether the command runs correctly or not, you won't see the screen display generated by this command.
Let's take a simple example.
The "dir" command can display the file and folder list of the current directory. At this time, if you use "dir >nul", you won't see the screen output of the dir command. Then what will happen if you type "dirr"? At this time, it will display " 'dirr' is not an internal command, nor an external command, nor a batch file." Then you may use "dirr >nul" to block this error message, but I tell you, your guess is wrong because the error message " 'dirr' is not an internal command, nor an external command, nor a batch file." will still appear. At this time, if you use "dirr >nul 2>nul", you won't see the above error message on the screen. I don't know if you understand it now.
If you want to know more about the explanation of nul, you can search in the forum. You can find the detailed and wonderful explanation of the usage of nul by brother willsort.
[ Last edited by lxmxn on 2006-10-26 at 12:33 AM ]
Recent Ratings for This Post
( 7 in total)
Click for details
| Rater | Score | Time |
| sglxy |
+6 |
2006-10-25 18:56 |
| beeny |
+2 |
2007-01-20 11:45 |
| baomaboy |
+2 |
2007-03-18 03:43 |
| zhxy9804 |
+2 |
2007-03-22 10:57 |
| haiou327 |
+2 |
2007-07-08 23:40 |
| Nickey |
+2 |
2008-02-15 18:02 |
| — |
+1 |
2009-11-17 22:39 |