0

I want know if its possible to delete a specific extension (for ex .txt [all text files]) in the recycle bin using the batch script.

i know that we can delete all .txt files in a particular directory by using "del *.txt" by being in that directory.

How to enter into recycle bin directory through command prompt?

Jayakumar
  • 153
  • 1
  • 13
  • there many tools to do that https://stackoverflow.com/q/9238953/995714 https://stackoverflow.com/a/1646493/995714 – phuclv Feb 27 '18 at 08:28

1 Answers1

1

I discovered on Windows 10 64bit All recycled files for all users are located in hidden system directory c:\$Recycle.Bin (assumed root is on disk c:)

c:\$Recycle.Bin>dir /A:HS
 Volume in drive C has no label.
 Volume Serial Number is D612-8F57

 Directory of c:\$Recycle.Bin

12.09.2016  11:31    <DIR>          .
12.09.2016  11:31    <DIR>          ..
21.04.2016  18:25    <DIR>          S-1-5-18
23.02.2018  10:47    <DIR>          S-1-5-21-1159227591-27907470-3834550114-1001
22.04.2016  09:16    <DIR>          S-1-5-21-1159227591-27907470-3834550114-500
22.04.2016  09:53    <DIR>          S-1-5-21-432234922-2319399979-3098640245-1188
12.09.2016  11:31    <DIR>          S-1-5-80-1019884434-2197690090-2714790520-3894210941-406293421
               0 File(s)              0 bytes
               7 Dir(s)  57 550 692 352 bytes free

Just an example, what will be in this directory. All this directories are security identifiers of users, not all files in recycle.bin is your user files You can obtain mapping of user names to sid, using management instrumentation

wmic useraccount get name,sid 

Your recycled files will be in the directory with my user, but you can list all

dir /s /b

Of course, if you have more then one disk/partition in your system, your files fill be also on d:\$Recycle.Bin, e:\$Recycle.Bin etc (dependent on location of removed file)

vitalygolub
  • 735
  • 3
  • 16