How can I delete large folders quickly and efficiently under the Windows virtual machine environment?

Source: Internet
Author: User
Tags python script

During the debugging stability test process, due to the smaller machine C drive, it is necessary to clean up the%tmp% directory and Recycle Bin.

Now my virtual machine's%tmp% directory has 150,000 files , how quickly and effectively delete it? Some of these files refuse to be deleted.

Method 1: Delete the Temp folder directly, it will always scan, and finally will tell you, can not delete, say what other places in use, and I have no;

Method 2: Go to the Temp folder, CTRL + A selects all files for deletion, but the explorer's address bar will always be in the loading process and cannot be deleted;

Method 3: One by one delete? directly without;

Method 4: Make a security guard, computer Butler and so on, using the powder machine, too troublesome, not necessarily can powder;

Method 5: Write a Python script: Shutil.rmtree (Tmppath), but because 150,000 files have a variety of files, some can not be deleted, resulting in the entire cannot delete;

Method 6: Then use the command line to try:rd/s/Q Tmppath, successful ~ ~ can see, refused to delete the file, in the DOS window also has a display, but can automatically jump over, so you can delete all the files can be deleted.


Analyze: Why is rd available?

Personal conjecture: question: Which of the command line and Windows API is closer to the bottom?

From the above results, the command line should be closer to the bottom. The operating system receives the input string, parses it, finds the corresponding instruction, and forwards the request command to the instruction to perform the specific operation.

Welcome to the "Sogou test" public discussion, welcomed the expert pointing ~ ~


Reprint Please specify: Http://blog.csdn.net/sogouauto

Explore test art, Exchange test technology, Welcome to the "Sogou test"


How can I delete large folders quickly and efficiently under the Windows virtual machine environment?

Related Article

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.