How to use CMD command to copy and delete folders under windows7?

  
                                    

Sometimes there are some stubborn files or folders that we can't delete you. Don't worry. In fact, the CMD command that comes with Win7 system can solve this problem very well. The following small series will introduce you to windows7. How to copy and delete folders with CMD commands.

If I want to copy the file folder of the f drive to the root directory of the c drive, how to use the cmd command? Very simple:

xcopy f:file c:file /e

If you want to delete it? Also simple: Assume to delete the 123 folder under the d drive

del/s/qd:123*.* ----(Used to delete the child under the folder File)

rd/s/qd:123 ----(used to delete folder)

/s parameter is subdirectory

/q parameter is not confirmed

Deleting files using the del command, then, is it like ren command to eat files and folders, del can also delete folders?

The answer is no, Because deleting the folder must use the rd command, this is called the industry has a specialization ^ _ ^.

Another way to write rd is rmdir, which comes from ReMakeDirectory. The method used is also very simple: rd folder name can be, for example: rd test. It supports folder names with paths, for example: rd d:test.

Sometimes, rd doesn't do a good job: you let it delete the test folder, but it arrogantly turns to you: the directory is not empty. However, this can't blame it for being lazy and not working, but its temper is a bit strange: if there are sub-files under the folder to be deleted, you have to give rd a top hat, add a /s parameter, it will be high I am happy to help you with things, so the correct way is: rd /s test.

If you are a complete slacker, just use rd /s test, you may not be satisfied with it, because when you delete the folder with the subfile, CMD always does not know the time Stop and ask you diligently: Do you confirm (Y/N)? You have to wait for you to lose a character and press Enter. Life can not blame the government, can not blame the society, who called rd has such a great power, once it is playing rogue, it can not stop anyone's — & mdash; rd risk, delete must be cautious. Fortunately, Microsoft is very considerate to those who are very confident and too lazy to delete, and provides a very convenient parameter /q, which is taken from quiet, the official explanation is: quiet mode, with /S to delete the directory tree is not required confirm. Try again this time: rd /q /s test, the real one is: the finger is flicking, the smoke is gone, is there a sense of ambiguity that doesn’t bother you?

Copyright © Windows knowledge All Rights Reserved