Alternative usage of copy commands (transfer)

xiaoxiao2021-03-06  38

Http://blog.blogchina.com/Article_10608.93501.htmldos's top Copy command can have other purposes, see. . . 1, print file

Since the copy command supports the device name, set the destination file name to the printer device name PRN or LPT1 to print:

C:> Copy AutoExec.bat PRN

Copy autoexe.bat to the printer, so that the printer prints AutoExec.bat.

The same principle, we can turn your computer into a typewriter through the copy command. The typewriter is a machine that is directly output by the printer by the keyboard.

C:> COPY CON PRN

The Con acting is the device name of the default output device display, but because the display content of the display can be entered with the keyboard, this command is actually output to the printer input to the printer. Press ^ C (Ctrl C) to exit.

2, display multiple files

In DOS, we usually use the type command to view the file content, but the Type command does not support wildcard, we want to see the content of multiple files once, there is some power, at this time, the copy command can help:

C:> Copy * .txtcon

To copy all TXT files in the directory to the display, you can display multiple file content at the same time, combine the printer device name, and you can also print multiple files in succession through the copy command.

3, file crusher

The deletion and recovery of the file has always been a headache. For a misused file, we hope to have a way to restore it, and we hope that the clearedness of the confidentiality, this is definitely a pair Contradiction, but it is also practical, so we often have two tat strokes in our computer: file recovery tools and file crushers. In fact, for the latter needs, you don't have to be so troublesome, the copy command is a very good file!

Use the copy command to delete the file, it seems to be a very incredible thing, but in fact, use a Copy to delete the file very thorough, because the write deletion (ie, write the original file location), and the file crusher The principle is the same, so it is basically unable to recover:

C:> COPY NUL file name

Write an empty device to a file to implement the delete file. Since the file is written, it cannot be restored. After using this method, after deleting a text file, use the big name Ding EasyRecovery to specify recovery, the resulting recovery result is a common file, but the content is empty, thereby visible with Copy Delete The power of the document. Oh, since then, we can use less software.

Http://www.net.com.cn/eschool/inforcenter/a20040215286371.html

1, display text file content: (= type)

Copy file name Con

2, display special file content:

COPY file name CON / B

3, display file name: (= DIR)

Copy *. * NUL

4, print file content:

COPY file name PRN

5. Print the content entered by the keyboard:

Copy Con PRN

6, delete files: (= DEL)

Copy NUL file name

7. Create a new file:

Copy Con File Name

8, change the date of the document:

Copy file name ,

9, connect two files:

Copy file 1 file 210, check two files:

Copy file 1 file 2 / v

转载请注明原文地址:https://www.9cbs.com/read-65762.html

New Post(0)