Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How to empty recycle bin on remote computers

$
0
0

Hi Team,

I'm trying empty the recycle bin on remote computers. I'm using the following code, it works fine on local machine but not on remote machine. Could somebody help me out?

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



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>