Step 1: Create a. bat file that automatically clears temporary files.
1. Start-all programs-accessories-notepad;
2. In the opened notepad, enter del folder path/q, left-click the File, and click save in the drop-down menu;
3. In the open save as window, click: Desktop, enter: temporary File cleanup. bat in the file name (N) column, and then click: save.
Step 2: Add the temporary file cleanup. bat file to the script shutdown file.
1. Start-run (enter gpedit. msc)-OK or press enter to open the local group policy editor;
2. In the open local group policy editor window, expand: computer configuration-Windows settings-script (start/stop), and left-click the shutdown button on the right of the window;
3. In the open shutdown properties window, click Add;
4. In the add Script window, click browse;
5. Find "temporary File cleanup. bat" on the opened desktop, and double-click the "temporary File cleanup. bat" button;
6. You have added a temporary file to clear the. bat file. Click "OK;
7. Return to the shutdown properties window and click: application-OK.