2

I am learning powershell, and am curious as to why the syntax Remove-Item does not put the file(s) in the recycle bin?

Where do these files go when you remove them, and are they recoverable?

I read the Technet article, but did not see anything in there that answered my question, so I ask here.

BoJack Horseman
  • 25
  • 1
  • 2
  • 6
  • 1
    "delete" from a command prompt doesn't put them in the recycling bin either, so it's not PowerShell specific. "Why" is only truly known by MS, it's a design choice, but in general the Recycling Bin is for the Explorer UI, not for command shells. – Ƭᴇcʜιᴇ007 Aug 31 '16 at 14:30
  • 1
    Also maybe check out [What is the command line way of sending files to the recycle bin?](http://superuser.com/questions/24662/what-is-the-command-line-way-of-sending-files-to-the-recycle-bin), and this StackOverflow question: [How do I move a file to the Recycle Bin using PowerShell?](http://stackoverflow.com/questions/502002/how-do-i-move-a-file-to-the-recycle-bin-using-powershell) – Ƭᴇcʜιᴇ007 Aug 31 '16 at 14:34
  • @Ƭᴇcʜιᴇ007 - I did not know it was this way with all programming. Thank you for letting me know. I will read up on the links to get more informed. VERY intriguing to me, that this is another mystery of Microsoft. – BoJack Horseman Aug 31 '16 at 14:43
  • @Ƭᴇcʜιᴇ007 - so theoretically even if the file skips the recycle bin, the file is still recoverable IF it has not been "overwritten" by a "new" file? – BoJack Horseman Aug 31 '16 at 14:54
  • Yup, as long as no data has actually overwritten it, you can usually restore it. – Ƭᴇcʜιᴇ007 Aug 31 '16 at 16:00

1 Answers1

-1

You can press the button of the keyboard without saving files in the Recycle Bin to delete

Shift + Delete

Recycle Bin files that are located in this folder

$RECYCLE.BIN

All partitions that are in this folder are of type NTFS

M.R.T
  • 187
  • 6
  • but if a file deleted through code does not go to the recycle bin, I could look at the $Recycle Bin folder and still see them? – BoJack Horseman Aug 31 '16 at 15:26
  • You can not change this folder, but you can see it.For example, this address:C:\$Recycle.Bin – M.R.T Aug 31 '16 at 15:30
  • To see the folder must do: Control Panel > All Control Panel Items > File Explorer Option > View > Hide Protected operation system file and uncheck it. – M.R.T Aug 31 '16 at 15:34