+ Post New Thread
Results 1 to 8 of 8
Windows Thread, Short term share in Technical; I want to create a short term share, one that will be empty every Monday morning. The reason behind this ...
  1. #1
    edie209's Avatar
    Join Date
    Mar 2006
    Location
    Kernow
    Posts
    639
    Thank Post
    37
    Thanked 11 Times in 11 Posts
    Rep Power
    18

    Short term share

    I want to create a short term share, one that will be empty every Monday morning.

    The reason behind this is teachers claiming they need to have an area to collect students work but want it to be deleted at the end of the week.

    Well no problem there I thought I would just schedule a bat file to delete the directory on Friday nights simple. but no.

    del command only deletes files not folders or at least I thought so I found a reference to /s switch that should delete folders but it won't for me.

    And it seems deltree won't work with a wildcard

    Anyone got another suggestion. I need the share to always remain but the contents to be deleted on a weekly basis

  2. IDG Tech News
  3. #2


    Join Date
    Jan 2006
    Posts
    7,765
    Thank Post
    422
    Thanked 962 Times in 747 Posts
    Rep Power
    307

    Re: Short term share

    what about recursively deleting files that are over 1 week old

  4. #3

    Join Date
    Mar 2007
    Posts
    1,467
    Thank Post
    57
    Thanked 186 Times in 169 Posts
    Rep Power
    46

    Re: Short term share

    try /S

  5. #4

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    7,711
    Thank Post
    1,574
    Thanked 740 Times in 691 Posts
    Rep Power
    254

    Re: Short term share

    DEL /S C:/PATH/to/BASEDIR/*.*

    obviously *.* will delete everything, best to try it on a test directory first just to ensure it works how you want it to.

  6. #5
    edie209's Avatar
    Join Date
    Mar 2006
    Location
    Kernow
    Posts
    639
    Thank Post
    37
    Thanked 11 Times in 11 Posts
    Rep Power
    18

    Re: Short term share

    /S doesn't seem to delete folders either

    I have been trying

    DEL /S/f/q C:/PATH/to/BASEDIR/*.*

    and

    DEL /s/f/q C:/PATH/to/BASEDIR/*.*

  7. #6

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    7,711
    Thank Post
    1,574
    Thanked 740 Times in 691 Posts
    Rep Power
    254

    Re: Short term share

    http://www.daniweb.com/forums/thread61479.html

    May take a lil while to load the page but hopefully that helps

  8. #7

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    62

    Re: Short term share

    Follow up

    CD "FULLPATHTODIRTOBECLEANED"
    DEL *.* /Q

    with

    for /D %I in (*) do RMDIR "%I" /S /Q

    DEL *.* will delete contents in the top level folder
    The FOR will loop and remove all directories and their subdirectories.

    In a batch file you'll need %%I, on the command line %I

    HTH

  9. #8
    edie209's Avatar
    Join Date
    Mar 2006
    Location
    Kernow
    Posts
    639
    Thank Post
    37
    Thanked 11 Times in 11 Posts
    Rep Power
    18

    Re: Short term share

    Thanks OutToLunch that works

SHARE:
+ Post New Thread

Similar Threads

  1. Who works term time only? How many full time?
    By gwendes in forum General Chat
    Replies: 45
    Last Post: 10th February 2007, 05:38 PM
  2. a short tale...
    By pinemarten in forum General Chat
    Replies: 0
    Last Post: 30th June 2006, 03:57 PM
  3. Half Term
    By Norphy in forum General Chat
    Replies: 71
    Last Post: 31st May 2006, 09:50 AM
  4. Replies: 17
    Last Post: 3rd August 2005, 11:21 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
  •