Win10方法

1.桌面→新增→捷徑

2.輸入項目的位置:C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -Command Clear-RecycleBin -force -ErrorAction:Ignore

3.輸入這個捷徑的名稱:隨意取

4.創造出的捷徑可以拉到工作列使用

 

Win7方法

win7因為沒有Clear-RecycleBin指令步驟較多較麻煩

1.桌面→新增→記事本

2.記事本內容:

$Shell = New-Object -ComObject Shell.Application
$RecBin = $Shell.Namespace(0xA)
$RecBin.Items() | %{Remove-Item $_.Path -Recurse -Confirm:$false}

3.存檔至任意位置(EX: C:\Users\xxx\Documents\) 名稱隨意取,但副檔名必需是ps1

4.桌面→新增→捷徑

5.輸入項目的位置:C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "C:\Users\xxx\Documents\clearbin.ps1"

6.輸入這個捷徑的名稱:隨意取

7.創造出的捷徑可以拉到工作列使用

 

注意:

1.紅色字的路徑需一致

2.若出現「檔案無法載入,因為這個系統已停用指令碼執行」,請用管理員權限打開 PowerShell,執行以下指令,打開執行權限:

$ Set-ExecutionPolicy RemoteSigned

 

本站其它方法參考:程式|一個按鍵清除資源回收桶的內容

arrow
arrow

    bshadow 發表在 痞客邦 留言(0) 人氣()