I want to list the files that are in the recycle bin in Vista from the command line. So far I have this:
dir C:\\$Recycle.Bin /s /b >> recyclebin.txt
<
To list files in Recycle Bin by their original location using PowerShell (save as file.ps1, remove line breaks before | so that you get only two lines):
(New-Object -ComObject Shell.Application).NameSpace(0x0a).Items()
|select @{n="OriginalLocation";e={$_.ExtendedProperty("{9B174B33-40FF-11D2-A27E-00C04FC30871} 2")}},Name
| export-csv -delimiter "\" -path C:\Users\UserName\Desktop\recycleBinFiles.txt -NoTypeInformation
(gc C:\Users\UserName\Desktop\recycleBinFiles.txt | select -Skip 1)
| % {$_.Replace('"','')}
| set-content C:\Users\UserName\Desktop\recycleBinFiles.txt