How does the computer set up the shutdown to automatically clean up a specified folder?

Source: Internet
Author: User

How does the computer set the shutdown to automatically clean up a specified folder? I hope some files in the shutdown, can automatically clean up, especially some temporary saved personal documents or pictures, do not want to shut down after the computer, but also to share the setting method.

1, first in the deleted file to build a text document outside the folder, the example deleted is the "2" folder all the pictures, so this text document must be built in the "2" folder, create a document method, in the blank right--> new-> text document.

2, and then open this text document, in the edit window input "del file path/q" Such a command, this article is to delete the d:12 below the picture, so this code should be written as: Del d:12/q

After writing, to save, be careful to delete the code format, del for the Delete command, and then a space, and then write to delete the folder path, another space, and then write/q parameters.

3, after the preservation, the text document suffix to the. bat format, that is, batch format, pop-up warning box, press "OK" can be, this clean file is made. This batch file name can be used casually, such as "Shutdown clean specified folder", but the suffix name must be. bat format,

4, here's how to set up this batch file to run automatically when the computer shuts down. In the Start menu, open Run, and then enter the "gpedit.msc" command to determine.

5, after entering the Group Policy window, select Windows Settings.

6, and then under Windows Settings, select Script (Start/shutdown) to the right window and select shutdown. Double click.

7, in the Shutdown Properties window, locate the Add button and click Open.

8, in the Add Script window, click the "Browse" button to load the batch file just created.

9, locate the "Shutdown cleanup specified folder. bat" batch file that you just created, press "open", and then go all the way back to "OK", "Apply" and "OK". The whole process is set up, when the shutdown, the batch file will be started to clean out the files under the specified folder.

10, if you want to terminate the batch processing at shutdown, also in the Shutdown Properties window, select a script to delete, press "delete" can be.

Note: This deletion method must be in the normal shutdown to be effective, if it is directly off the power of the method, is unable to start the delete script, you can not delete the specified file.

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.