How do I get Windows 7 to NOT use the recycling Bin on a removable drive?

18

4

How do I get Windows 7 to NOT use the recycling Bin on a removable drive? I've already told Windows to not use the function on that drive but Windows still creates the "Recycling Bin" folder. It stays empty, but I don't want it there at ALL. Simply hiding it won't do. I'm using that removable drive in my car stereo and that "recycled" folder locks up the machine.

JimDel

Posted 2009-11-29T21:12:29.383

Reputation: 1 834

3

I agree that the Recycle Bin being forced on every mounted fixed volume without the option to disable it is bad and poor design. I just (not for the first time) ran into a situation where it is *horrible* because it causes problems with data-recovery. I lost a bunch of files on a volume, so I stopped using that drive to prevent anything being overwritten, yet stupid Windows went ahead and wrote stuff to the Recycle Bin files, thus overwriting a file, even though I did NOT modify any files on that volume!

– Synetech – 2012-10-28T20:49:08.200

1How do I get Windows 7 to NOT use the recycling Bin on a removable drive?  Define “removable”. Windows only creates a Recycle Bin on fixed (read internal) and external hard-drives. In both cases, including external drives, they are not considered removable drives. Windows only considers floppies, memory-cards, and flash-drives as “removable” and does not create or use a Recycle Bin on those. This question was presumably talking about an external hard-drive as opposed to a removable drive on which Windows does create a Recycle Bin. – Synetech – 2013-11-17T21:02:26.500

Answers

2

Recycle Bin is a system directory and gets created anyway. There may be a registry hack, but restoring the OS, or installing a hotfix may reset it - so don't bother.

To avoid seeing the Recycle Bin, do the following:

  1. Hide operating system files in "Folder and search options":

    enter image description here

  2. Make sure deleted files do not get copied to the Recycle Bin (by right-clicking it):

    enter image description here

  3. Hide the Recycle Bin by personalizing the desktop:

    enter image description here

Traveling Tech Guy

Posted 2009-11-29T21:12:29.383

Reputation: 8 743

@TravelingTechGuy, Regarding "add a task that will run upon device disconnect", how would you do that? Surely schtasks couldn't do that right, It's too late to try and delete it when the device is already disconnected. – Pacerier – 2015-04-25T16:54:42.507

2> Another thing which may work for you is renaming the recycle bin's folder name to a normal string (no $ or .)…   @TravelingTechGuy, that doesn’t change the filename of the recycle bin’s folder(s), it only lets you change the name of the desktop icon; it has no effect on the actual folder(s). – Synetech – 2012-10-24T03:47:07.563

2This is not a solution. It disables the bin for all drives instead of just the selected one(s). – Synetech – 2012-10-28T20:50:05.313

4That's good info but the reason I'm looking for it to NOT be there at all is because when I plug that removable drive into my car stereo, that folder crashes it. I know it sounds funny to say your car stereo crashes, but it doesn't know how to deal with that folder. Your steps above only "hide" that folder. I need for it to not exist at all. But thanks. – JimDel – 2009-11-30T00:34:50.203

Ok - I assume your device gets shot by the $ in front of the directory name. Try this: before unplugging the removable drive, open a command prompt by right clicking it and selecting run as administrator, then type the following rd /s /q C:\$Recycle.bin (or whatever the drive you want) and disconnect. If this works, you can roll this into a batch script and add a task that will run upon device disconnect. – Traveling Tech Guy – 2009-11-30T01:22:18.513

Another thing which may work for you is renaming the recycle bin's folder name to a normal string (no $ or .) - try this tip: http://www.computerfreetips.com/window_xp/c_bin_xp.html

– Traveling Tech Guy – 2009-11-30T01:25:30.793

1If you follow step 2, then forcibly remove the directory, does it get recreated the next time you insert the disk? – Jason R. Coombs – 2009-11-30T04:01:29.940

2Yes (too short padding to get to 15 chars :)) – Traveling Tech Guy – 2009-11-30T07:09:18.550

6

but Windows still creates the "Recycling Bin" folder

That is pretty easy to be avoided:

Delete the folder, open Notepad and save the blank file as $Recycle.Bin in the root directory of the drive in question, now Windows cannot create the folder.

enter image description here

If you want to use the Recycle Bin again on this drive, just delete the file.

enter image description here

Molly7244

Posted 2009-11-29T21:12:29.383

Reputation:

1@Synetech If you are trying to do data recovery, I'd advise using Linux instead. – Aaron Franke – 2017-10-24T21:57:23.727

Data recovery? The whole point of this question is the premise that you do NOT want to use the Recycle Bin for that purpose. It presumes you have something like Acronis True Image for actual data recovery. – SDsolar – 2018-01-15T15:36:51.103

4This is not a solution because Windows just re-creates the bin on every drive the moment any operation access it on any drive (e.g., if you delete a file on C:, then Windows creates the bin folder on every volume). This is unacceptable because it makes it effectively impossible to do data-recovery because Windows is writing to the volume for no reason. – Synetech – 2012-10-28T20:51:21.320

4

Mount the drive under a Linux disk like Clonezilla and make a sector-by-sector copy. That way you have a copy to mess with and not the original. I don't think you can stop the default Windows process of creating a hidden Recycle Bin folder in each drive, but many Linux systems (like Puppy Linux) will not touch the drive with a write operation until you tell them to.

EDIT: My bad I was responding to a different post. However, if you boot your Windows machine with a Puppy Linux disk, THEN insert your external drive, you can delete the recycler and move your mp3s to your drive without getting any unwanted files written to the drive. Then you can remove your mp3 drive, remove the Puppy disk, and reboot to Windows without too much hassle. I don't know of any actual way to stop the hidden recycler file from being thrown on the drive, but this would work around it.

DigitalGalaxy

Posted 2009-11-29T21:12:29.383

Reputation: 41

1Oops! I was responding to a different post >.< My mistake, you are correct. However, the OP could still use a Puppy Linux disk to move files for his car stereo and avoid having any hidden recycler files written to the drive. – DigitalGalaxy – 2012-12-06T23:02:24.710

Why don't you edit this to say that? (Would work with modern Linux like Ubuntu/Fedora/Mint too.) – WindowsEscapist – 2012-12-06T23:34:11.010

2

"How do I get Windows 7 to NOT use the recycling Bin on a removable drive?"

Run the following script on startup or login.

Source Windows 7: Disable creation of $recycle.bin folder?:

Yes this can be done... because I got annoyed that it can't be done so I wrote a script to do it (see below). It works for me but if you have any issues yourselves you may need to tweak it a bit.

' Author:      HSV Guy
' Description: Script to remove Recycle Bin folder. Run on Windows startup or login.
' Notes: 1)    See http://www.sevenforums.com/tutorials/11949-elevated-program-shortcut-without-uac-prompt-create.html
'              for how to run programs/scripts with elevated permissions without a UAC prompt.
'        2)    Update value of RECYCLEBIN as per version of Windows (configured for Windows 7).
' Date:        1 April 2011

Dim SILENT
SILENT = TRUE

Call RunElevated

Dim filesys, drv, drvcoll, folder, RECYCLEBIN
RECYCLEBIN = ":\$Recycle.Bin\"

Set filesys = CreateObject("Scripting.FileSystemObject")
Set drvcoll = filesys.Drives


For Each drv in drvcoll
  If drv.IsReady And filesys.FolderExists(drv.DriveLetter & RECYCLEBIN)  Then
     Set folder = filesys.GetFolder(drv.DriveLetter & RECYCLEBIN)
     MyMsgBox "About to delete: " & folder
     folder.Delete
  Else
    MyMsgBox "Skipped " & drv.DriveLetter & ". Folder doesn't exist or device not ready."
  End If  
Next

'Source code of RunElevated function shamelessly taken from:
' http://www.insidethe.com/blog/2009/12/how-to-launch-a-wsh-vbscript-as-administrator-in-windows-7-and-vista/
Function RunElevated
    If WScript.Arguments.Named.Exists("elevated") = False Then
        'Launch the script again as administrator
        CreateObject("Shell.Application").ShellExecute "wscript.exe", """" & WScript.ScriptFullName & """ /elevated", "", "runas", 1
        WScript.Quit
    Else
        'Change the working directory from the system32 folder back to the script's folder.
        Set oShell = CreateObject("WScript.Shell")
        oShell.CurrentDirectory = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
         MyMsgBox "Now running with elevated permissions" & SILENT
    End If
End Function

Function MyMsgBox(Message)
    If Not SILENT Then MsgBox Message
End Function

DavidPostill

Posted 2009-11-29T21:12:29.383

Reputation: 118 938

Please explain what does the script do? – Pacerier – 2015-04-25T16:58:55.100

"Script to remove Recycle Bin folder. Run on Windows startup or login." – DavidPostill – 2015-04-25T20:38:43.313

0

As for explorer, there seems to be corresponding group policy under User Configuration/Administrative Templates/Windows Components/Windows Explorer called "Do not move deleted files to the Recycle Bin". Not sure if it works only for Windows Explorer or entire system tho.

Group policy

Ilia Andrienko

Posted 2009-11-29T21:12:29.383

Reputation: 101