+ 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,699
    Thank Post
    1,782
    Thanked 2,168 Times in 1,603 Posts
    Rep Power
    769

    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 09:57 AM.

  2. #2

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,751
    Thank Post
    1,622
    Thanked 1,876 Times in 1,394 Posts
    Blog Entries
    2
    Rep Power
    422
    I have a VBS script if you want that?

  3. #3

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,751
    Thank Post
    1,622
    Thanked 1,876 Times in 1,394 Posts
    Blog Entries
    2
    Rep Power
    422
    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 nephilim from:

    elsiegee40 (18th November 2008)

  5. #4

    elsiegee40's Avatar
    Join Date
    Jan 2007
    Location
    Kent
    Posts
    10,699
    Thank Post
    1,782
    Thanked 2,168 Times in 1,603 Posts
    Rep Power
    769
    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 12:31 PM.

  6. #5

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,751
    Thank Post
    1,622
    Thanked 1,876 Times in 1,394 Posts
    Blog Entries
    2
    Rep Power
    422
    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,699
    Thank Post
    1,782
    Thanked 2,168 Times in 1,603 Posts
    Rep Power
    769
    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
    718
    Thank Post
    119
    Thanked 64 Times in 52 Posts
    Rep Power
    31
    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,699
    Thank Post
    1,782
    Thanked 2,168 Times in 1,603 Posts
    Rep Power
    769
    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

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,751
    Thank Post
    1,622
    Thanked 1,876 Times in 1,394 Posts
    Blog Entries
    2
    Rep Power
    422
    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,032 Times in 812 Posts
    Rep Power
    339
    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
    12
    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,712
    Thank Post
    133
    Thanked 181 Times in 132 Posts
    Rep Power
    108
    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: 1st March 2010, 11:32 PM
  2. Remove files in the recycle Bin at logoff
    By timbo343 in forum Windows
    Replies: 5
    Last Post: 14th November 2008, 06:14 PM
  3. Redirect Student Recycle Bin to Storage Box
    By danrhodes in forum Windows
    Replies: 7
    Last Post: 17th October 2008, 07:54 PM
  4. Recycle bin
    By chrbb in forum Windows
    Replies: 15
    Last Post: 28th April 2008, 07:41 PM
  5. Replies: 3
    Last Post: 29th June 2006, 07: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
  •