簡體   English   中英

使用PS:如何強制刪除文件而不發送到回收站?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM