+ Post New Thread
Results 1 to 12 of 12
Scripts Thread, Empty recycle bin after n days in Coding and Web Development; Is it possible to delete the contents of the recycle bin of items that have been there for longer than ...
  1. #1

    elsiegee40's Avatar
    Join Date
    Jan 2007
    Location
    Kent
    Posts
    10,195
    Thank Post
    1,923
    Thanked 2,413 Times in 1,767 Posts
    Rep Power
    840

    Question Empty recycle bin after n days

    Is it possible to delete the contents of the recycle bin of items that have been there for longer than N days (say 14)?

    Hoping a script guru could help? Ta!
    Last edited by elsiegee40; 18th November 2008 at 10:57 AM.

  2. #2

    featured_spectre's Avatar
    Join Date
    Nov 2008
    Posts
    12,501
    Thank Post
    1,684
    Thanked 2,053 Times in 1,491 Posts
    Blog Entries
    2
    Rep Power
    464
    I have a VBS script if you want that?

  3. #3

    featured_spectre's Avatar
    Join Date
    Nov 2008
    Posts
    12,501
    Thank Post
    1,684
    Thanked 2,053 Times in 1,491 Posts
    Blog Entries
    2
    Rep Power
    464
    file is attached to this post... Double click it and it does the rest, but you have to do it manually as there is no physical way to get it to do it automatically that I know of, unless someone else is a guru of script!
    Attached Files Attached Files

  4. Thanks to featured_spectre from:

    elsiegee40 (18th November 2008)

  5. #4

    elsiegee40's Avatar
    Join Date
    Jan 2007
    Location
    Kent
    Posts
    10,195
    Thank Post
    1,923
    Thanked 2,413 Times in 1,767 Posts
    Rep Power
    840
    Quote Originally Posted by nephilim View Post
    but you have to do it manually as there is no physical way to get it to do it automatically
    But I could use this as a logoff script?

    I don't need the number of days to be changeable, just to make sure that old material is dleeted and doesn't build up.
    Last edited by elsiegee40; 18th November 2008 at 01:31 PM.

  6. #5

    featured_spectre's Avatar
    Join Date
    Nov 2008
    Posts
    12,501
    Thank Post
    1,684
    Thanked 2,053 Times in 1,491 Posts
    Blog Entries
    2
    Rep Power
    464
    then yes, use it as a part of your log off / log on script.

  7. #6

    elsiegee40's Avatar
    Join Date
    Jan 2007
    Location
    Kent
    Posts
    10,195
    Thank Post
    1,923
    Thanked 2,413 Times in 1,767 Posts
    Rep Power
    840
    Quote Originally Posted by nephilim View Post
    then yes, use it as a part of your log off / log on script.
    Great! Exactly what I needed!

  8. #7

    Join Date
    Jun 2008
    Posts
    745
    Thank Post
    121
    Thanked 70 Times in 57 Posts
    Rep Power
    33
    I used this script as a logoff but I get an error. Sorry, I know it's a vague, but that's what I get with everybody when they logoff. Have either of you guys experienced this?

  9. #8

    elsiegee40's Avatar
    Join Date
    Jan 2007
    Location
    Kent
    Posts
    10,195
    Thank Post
    1,923
    Thanked 2,413 Times in 1,767 Posts
    Rep Power
    840
    Quote Originally Posted by Chuckster View Post
    I used this script as a logoff but I get an error. Sorry, I know it's a vague, but that's what I get with everybody when they logoff. Have either of you guys experienced this?
    I haven't applied it yet... I'm waiting until we get rid of the kids on Dec 12th before I start messing about!

  10. #9

    featured_spectre's Avatar
    Join Date
    Nov 2008
    Posts
    12,501
    Thank Post
    1,684
    Thanked 2,053 Times in 1,491 Posts
    Blog Entries
    2
    Rep Power
    464
    use it with the log on script. If you do it with the log off script then you will get errors as it is unable to run. I know that if you do it from log in it will kick in and remove everything from the recycle bin as the said person logs in.

  11. #10


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,033 Times in 813 Posts
    Rep Power
    341
    Our recycle bins are held on the students network drive (a samba share)
    We run this through a weekly cron
    Code:
     /usr/bin/find /home/DOMAIN/ -type d -name .recycle -exec rm -rf  {}  \;

  12. #11
    networkingNut's Avatar
    Join Date
    Oct 2008
    Location
    Midlands
    Posts
    144
    Thank Post
    15
    Thanked 2 Times in 2 Posts
    Rep Power
    13
    Quote Originally Posted by nephilim View Post
    file is attached to this post... Double click it and it does the rest, but you have to do it manually as there is no physical way to get it to do it automatically that I know of, unless someone else is a guru of script!
    For some reason when running this as either a logon or logoff script as astudent I get a permission denied error on line 14

    Any ideas?

    nN

  13. #12

    sippo's Avatar
    Join Date
    May 2008
    Location
    Swindon, Wiltshire
    Posts
    1,804
    Thank Post
    145
    Thanked 239 Times in 155 Posts
    Rep Power
    163
    Sorry to bump an old thread, as it was linked I thought I would add my issue here. I also get permission denied even when added as a log-on or log off script. Any idea's?



SHARE:
+ Post New Thread

Similar Threads

  1. open recycle bin from run cmd
    By thegrassisgreener in forum Windows
    Replies: 6
    Last Post: 2nd March 2010, 12:32 AM
  2. Remove files in the recycle Bin at logoff
    By timbo343 in forum Windows
    Replies: 5
    Last Post: 14th November 2008, 07:14 PM
  3. Redirect Student Recycle Bin to Storage Box
    By danrhodes in forum Windows
    Replies: 7
    Last Post: 17th October 2008, 08:54 PM
  4. Recycle bin
    By chrbb in forum Windows
    Replies: 15
    Last Post: 28th April 2008, 08:41 PM
  5. Replies: 3
    Last Post: 29th June 2006, 08:01 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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