Windows 下使用 Win+R 一鍵清空回收站
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/1297
Windows 下使用 Win+R 一鍵清空回收站
平時我習慣把一些常用命令放進 PATH,
這樣可以直接:
Win + R
輸入:
clean
快速執行。
這次是用來一鍵清空回收站。
使用的命令
C:\Windows\System32\cmd.exe /c "echo Y | PowerShell.exe -NoProfile -Command Clear-RecycleBin"
作用:
-
cmd.exe /c
執行完後自動退出 -
echo Y |
自動確認 PowerShell 的詢問 -
PowerShell.exe -NoProfile
不加載使用者 Profile,啟動更快 -
Clear-RecycleBin
清空回收站
我的使用方式
我會建立一個快捷方式:
目標:
C:\Windows\System32\cmd.exe /c "echo Y | PowerShell.exe -NoProfile -Command Clear-RecycleBin"
然後:
-
命名為
clean -
放到 PATH 裡的資料夾
例如:
C:\Tools\
之後就可以:
Win + R
clean
直接清空回收站。
補充
其實也可以使用:
Clear-RecycleBin -Force
但這裡保留原命令,方便未來直接查詢與複製。
This article was last edited at