[英]Using PS: How to force delete files without sending to Recycle Bin?
我在任務調度程序中使用以下腳本每天刪除一些文件:
Get-ChildItem -Path "C:\Temp\*.txt" -force -ErrorAction SilentlyContinue | where {($_.LastwriteTime -lt (Get-Date).AddDays(-1) ) -and (! $_.PSIsContainer)} | Remove-Item -Verbose -Force -ErrorAction SilentlyContinue
有用。 但是,這些文件將被發送到回收站。 所以我們仍然需要偶爾清空回收站。 有沒有辦法通過使用 PS 腳本(或 Windows 中的某些設置)發送到回收站來刪除文件?
謝謝
remove-item
刪除文件而不將其發送到回收站。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.