+ 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
    671
    Thank Post
    41
    Thanked 17 Times in 16 Posts
    Rep Power
    22

    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. #2


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339

    Re: Short term share

    what about recursively deleting files that are over 1 week old

  3. #3

    Join Date
    Mar 2007
    Posts
    1,784
    Thank Post
    80
    Thanked 293 Times in 224 Posts
    Rep Power
    86

    Re: Short term share

    try /S

  4. #4

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,785
    Thank Post
    3,292
    Thanked 1,054 Times in 975 Posts
    Rep Power
    365

    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.

  5. #5
    edie209's Avatar
    Join Date
    Mar 2006
    Location
    Kernow
    Posts
    671
    Thank Post
    41
    Thanked 17 Times in 16 Posts
    Rep Power
    22

    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/*.*

  6. #6

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,785
    Thank Post
    3,292
    Thanked 1,054 Times in 975 Posts
    Rep Power
    365

    Re: Short term share

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

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

  7. #7

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

    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

  8. #8
    edie209's Avatar
    Join Date
    Mar 2006
    Location
    Kernow
    Posts
    671
    Thank Post
    41
    Thanked 17 Times in 16 Posts
    Rep Power
    22

    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
  •