如果您已从 PC 中删除了所有缓存文件并想知道为什么它对存储空间没有任何影响,您可能忘记清空回收站(Recycle)。每次我们从 PC 中删除任何文件或文件夹时,它都会进入回收站(Recycle),您可以随时恢复这些文件。
我们经常忘记清空回收站(Recycle bin),直到它开始占用太多空间,但是,当您在 Windows 11/10 上注销时,您可以使用一些技巧来自动清空回收站。如果您倾向于删除大量文件,这可能特别有用。
退出时如何自动清空回收站(Recycle Bin)
注销Windows 11/10时,有两种不同的方法可以自动清空回收站。请记住,您需要以管理员身份登录 PC 才能使用这些方法。
1]退出时使用(Use)Bat文件清空回收站(Recycle Bin)
您可以通过创建文本文档格式的Powershell脚本来自动清空回收站。当您关闭 PC 时,此脚本将删除回收站中的所有项目。
要打开文本文档,请右键单击桌面空白处的任意位置并从上下文菜单中选择新建(New),然后从下拉菜单中选择文本文档。(Text Document)
它将在您的桌面上创建一个文本文档文件。打开它并在那里复制粘贴给定的代码。
PowerShell.exe -NoProfile -Command Clear-RecycleBin -Confirm:$false
然后使用 .bat 扩展名保存您的文本文件,例如,如果您将其保存为空回收站,请在文件名后添加 .bat。
按 Enter 键(Hit Enter),它将保存为桌面(Desktop)上的Windows 批处理文件(Windows Batch File)。
我知道我们说过回收站文件会被自动删除,但实际上你必须运行这个Windows 批处理文件(Windows Batch File)才能删除它们。这只是一个单击过程。
单击(Click)Windows 批处理文件(Windows Batch File),回收站中的文件将被删除。
相关(Related):强制 Windows 同时清空所有用户的回收站。
2]使用组策略编辑器(Group Policy Editor)注销时自动清空回收站(Empty Recycle Bin)
这是一种在您关闭或退出 PC 时清空回收站的全自动方法。使用组策略编辑器(Group Policy Editor),您可以使该过程自动化。
- 通过同时按下Windows 键(Windows Key)和 R 热键打开运行(Run)对话框。
- 输入 gpedit.msc 并点击 OK。
- 组策略编辑器(Group Policy Editor)打开后,转到:
- Computer Configuration > Windows Settings > Scripts > Shutdown
- 单击关闭,然后单击添加。
- 浏览(Browse)并添加我们在上述方法中创建的Windows 批处理文件。(Windows Batch File)
- 单击确定。
现在,此脚本设置为在您关闭 PC 时自动运行。因此,当您关闭 PC 时,您的回收站将自动清空。
我已经在我的Windows 10 PC 上尝试过这些方法,但它可能不适用于早期版本的Windows。
由于此方法会自动从回收站(Recycle)中删除所有文件和文件夹,因此请确保您已交叉检查回收站中的文件。
3]存储感
第三种方法是通过Storage Sense来完成。您可以 通过 Storage Sense 自动从回收站中删除文件(automatically delete files from the Recycle Bin via Storage Sense)。
视窗 11
跟着这些步骤:
- 通过 Win + I 或从开始菜单打开 设置 。(Settings )
- 确保您位于 System 选项卡上,然后单击 Storage。
- 启用,然后选择Storage Sense 。
- 你会看到 删除我的回收站中的文件,如果他们已经在那里了(Delete files in my recycle bin if they have been there for over)
- 选择 bin 文件的生命周期,之后它们应该被Storage Sense删除。选项包括:
视窗 10
按Win+I打开您的 PC设置。 (Settings. )在搜索框中输入 Storage Sense 并打开它。(Storage Sense)单击(Click)配置存储感知或立即运行它 (Configure Storage Sense or run it now. )。
您可以在此处选择并设置要删除的文件的时间跨度,可以是每天、每周或每月。或者您可以将其设置为在磁盘空间不足时删除。
同样,您可以调整设置以删除 PC 上的临时文件。
您还可以通过单击立即清理来立即(Clean Now)释放空间。
如果您不想自动删除文件或想手动删除它们,请确保将设置设置为Never。
如何从桌面删除(Desktop)回收站(Recycle Bin)图标
运行(Run) gpedit.msc 打开本地组策略编辑器(Local Group Policy Editor)。Select User Configuration > Administrative Templates > Double-click Desktop。现在双击桌面上的 删除回收站(Remove Recycle Bin)图标,然后单击设置(Setting)选项卡。
(Does)空回收站(Recycle Bin)会永远删除文件吗?
是的,当您清空回收站时,文件和文件夹不会永远删除。您可能需要使用数据橡皮擦软件(data eraser software)从硬盘中删除文件。要恢复从回收站(Recycle Bin)中删除的文件,您需要使用数据恢复软件(data recovery software)——您可以使用它来恢复您的数据。
希望这可以帮助。
How to empty Recycle Bin automatically while signing out on Windows 11
If you have deleted all the сache files from your PC and wondering why it didn’t make any differеnce to the storage space, you probably forgot to empty thе Recуcle bin. Evеry time we delete any file or folder from oυr PC, it goes to the Recycle bin аnd you can restore thоse files whenever уou want.
We often forget about emptying the Recycle bin until it starts occupying too much space, however, there are a few tips that you can use to empty the recycle bin automatically while you sign out on Windows 11/10. This can be especially useful if you tend to delete a lot of files.
How to empty Recycle Bin automatically while signing out
There are two different methods to empty the Recycle Bin automatically while you are signing out for Windows 11/10. Remember that you need to be logged into your PC as the administrator to use these methods.
1] Use a Bat file to empty Recycle Bin while signing out
You can empty the recycle bin automatically by creating a Powershell script in text document format. This script will delete all the items from your recycle bin when you turn off your PC.
To open a text document, right-click anywhere in the black space on your desktop and select New from the context menu, and then select Text Document from the dropdown menu.
It will create a text document file on your desktop. Open it and copy-paste the given code there.
PowerShell.exe -NoProfile -Command Clear-RecycleBin -Confirm:$false
Then save your text file with an extension of .bat, for example, if you are saving it as an empty recycle bin, add .bat after the file name.
Hit Enter and it will be saved as a Windows Batch File on your Desktop.
I know we said the recycle bin files will be deleted automatically, but you actually have to run this Windows Batch File to delete them. It’s just a single-click process.
Click on the Windows Batch File and the files in your recycle bin will be deleted.
Related: Force Windows to empty Recycle Bins of all Users at the same time.
2] Empty Recycle Bin automatically while signing out using Group Policy Editor
This is a fully automated method to empty the recycle bin when you turn off or sign out of the PC. Using the Group Policy Editor, you can make the process automatic.
- To open the Run the dialogue box by pressing Windows Key and R hotkey together.
- Type gpedit.msc and hit OK.
- Once Group Policy Editor is open, go to:
- Computer Configuration > Windows Settings > Scripts > Shutdown
- Click on Shutdown and click on Add.
- Browse and add the Windows Batch File we created in the above method.
- Click OK.
Now, this script is set to run automatically whenever you shut down your PC. Thus, your recycle bin will automatically be emptied when you shut down your PC.
I have tried these methods on my Windows 10 PC and it might not work on the earlier versions of Windows.
Since this method will automatically delete all your files and folders from Recycle bin, make sure you have crossed checked the files in the bin.
3] Storage Sense
The third method is to do it via Storage Sense. You can automatically delete files from the Recycle Bin via Storage Sense.
Windows 11
Follow these steps:
- Open Settings by Win + I or from the Start Menu.
- Make sure that you are on the System tab and click Storage.
- Enable and then select Storage Sense.
- You will see Delete files in my recycle bin if they have been there for over
- Select the lifespan of your bin files, after which they ought to be deleted by Storage Sense. The options are:
- Never
- 1 day
- 14 days
- 30 days
- 60 days.
Windows 10
Press Win+I to open your PC Settings. Type Storage Sense in the search box and open it. Click on Configure Storage Sense or run it now.
Here you choose and set the time span of the files you want to delete, it could be every day, every week, or month. Or you can set it to delete when the disk running low in space.
Similarly, you can adjust the settings to delete the temporary files on your PC.
You can also free up space instantly by clicking on Clean Now.
If you don’t want the files to be deleted automatically or want to delete them manually, make sure you set the settings to Never.
How to remove Recycle Bin icon from Desktop
Run gpedit.msc to open the Local Group Policy Editor. Select User Configuration > Administrative Templates > Double-click Desktop. Now double-click the Remove Recycle Bin icon from the desktop and click on the Setting tab.
Does empty Recycle Bin delete files forever?
Yes, when you empty your recycle bin, the files and folders are not deleted forever. You may need to use a data eraser software to delete the files from the hard disk. To recover files deleted from the Recycle Bin, you need to use a data recovery software – You can use it to restore your data.
Hope this helps.