Introduction to DOS Pipe Commands
Written from memory, please point out or supplement any errors or omissions.
The function of DOS pipe commands is to redirect the output of software. Using them, we can easily intercept the output information of DOS software.
For example, if I want to write an article about the COPY command in DOS and need to use its parameter information, I can use the command copy /? >mycopy.txt, which will input the help information of the COPY command into the text file mycopy.txt. I can modify mycopy.txt to become my article.
If I also need to write about the XCOPY command, I can use xcopy /? >>mycopy.txt to get the parameter information of the XCOPY command again. The difference between >> and > is that if the target file mycopy.txt is not empty, >> will append the new content to the original content, while > will overwrite the original content. > and >> are the special symbols of DOS pipe commands.
Since DOS treats devices as files, including the empty target NUL, pipe commands can also be used to do some other work.
For example: type autoexec.bat >prn OR type autoexec.bat >lpt1 can simply test the printer
copy command.com d:\ >nul will copy command to drive D without any information
If your autoexec.bat is written with DELTREE /Y C:\*.* >NULL, the next time you start up, you will lose all the data on drive C in a frenzy of hard disk light flashing, and there will be no prompt information on the screen.
Written from memory, please point out or supplement any errors or omissions.
The function of DOS pipe commands is to redirect the output of software. Using them, we can easily intercept the output information of DOS software.
For example, if I want to write an article about the COPY command in DOS and need to use its parameter information, I can use the command copy /? >mycopy.txt, which will input the help information of the COPY command into the text file mycopy.txt. I can modify mycopy.txt to become my article.
If I also need to write about the XCOPY command, I can use xcopy /? >>mycopy.txt to get the parameter information of the XCOPY command again. The difference between >> and > is that if the target file mycopy.txt is not empty, >> will append the new content to the original content, while > will overwrite the original content. > and >> are the special symbols of DOS pipe commands.
Since DOS treats devices as files, including the empty target NUL, pipe commands can also be used to do some other work.
For example: type autoexec.bat >prn OR type autoexec.bat >lpt1 can simply test the printer
copy command.com d:\ >nul will copy command to drive D without any information
If your autoexec.bat is written with DELTREE /Y C:\*.* >NULL, the next time you start up, you will lose all the data on drive C in a frenzy of hard disk light flashing, and there will be no prompt information on the screen.
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos



