Results 1 to 4 of 4

Thread: How Can I Read/Change The Maximum Size Of The Recycle Bin ??

  1. #1

    Thread Starter
    Hyperactive Member techman2553's Avatar
    Join Date
    Mar 2001
    Location
    <- To your left.
    Posts
    362
    If you send files to the recycle bin (say 57,458 graphic files) through code, you run the risk of exceeding the maximum recycle bin size (usually 10% or drive space) and having the oldest files permanently deleted.

    How can I read the current setting for the Maximum Recycle Bin size for a given partition ??

    Then... How can I increase that number if I wanted to ???

    Thanks !!!

  2. #2
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    you get get the size and number of items currently in the recycle bin with this code

    Hope it helps

    Code:
    ' This code is licensed according To the terms And conditions listed here.
    
    ' Display the number of items In the Recycle Bin On the C:
    ' drive And the size of it.
    Dim rbinfo As SHQUERYRBINFO  ' information about the bin
    Dim retval As Long  ' return value
    
    ' Initialize the size of the structure.
    rbinfo.cbSize = Len(rbinfo)
    ' Query the contents of C:'s Recycle Bin.
    retval = SHQueryRecycleBin("C:\", rbinfo)  ' the path doesn't have To be the root path
    ' Display the number of items In the Recycle Bin, If the value is
    ' within Visual Basic's numeric display limits.
    If (rbinfo.i64NumItems.LowPart And &H80000000) = &H80000000 Or rbinfo.i64NumItems.HighPart > 0 Then
      Debug.Print "Recycle Bin contains more than 2,147,483,647 items."
    Else
      Debug.Print "Recycle Bin contains"; rbinfo.i64NumItems.LowPart; "items."
    End If
    ' Likewise display the number of bytes the Recycle Bin is taking up.
    If (rbinfo.i64Size.LowPart And &H80000000) = &H80000000 Or rbinfo.i64Size.HighPart > 0 Then
      Debug.Print "Recycle Bin consumes more than 2,147,483,647 bytes."
    Else
      Debug.Print "Recycle Bin consumes"; rbinfo.i64Size.LowPart; "bytes."
    End If
    I will look for what you want in the registry
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  3. #3

    Thread Starter
    Hyperactive Member techman2553's Avatar
    Join Date
    Mar 2001
    Location
    <- To your left.
    Posts
    362

    The SHQueryRecycleBin API Won't Return The Maximum Size.

    Thanks for the response, however I have played with this sample code, and it can only tell you how much space is consumed by recycled items. I need to know how much more room there is in that magic garbage can.

    Any ideas ???

    Thanks.

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    There are 3 API calls which deal with the recycle bin :
    • SHEmptyRecycleBin
    • SHQueryRecycleBin
    • SHUpdateRecycleBinIcon


    But I have never come accross this before, I don't think it's possible and as above, is probably a registry setting.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width