home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 41,012 of 42,547   
   foxidrive to justin.lamantia@gmail.com   
   Re: Batch File to Create 25 backs up the   
   19 Sep 14 04:21:06   
   
   From: foxidrive@server.invalid   
      
   On 19/09/2014 03:51, justin.lamantia@gmail.com wrote:   
   >   
   >>   
   >>> Basically a circulatory back up that keeps the newest 25 folders always...   
   >>   
   >>   
   >>   
   >> Test this - it changes to a folder and then lists the oldest folders if   
   there are more than 25   
   >>   
   >> folders in there.  The && ensures that the FOR command only runs if the   
   folder is located.   
   >>   
   >>   
   >>   
   >> The key is to sort the DIR by reverse date using /O-D   
   >>   
   >>   
   >>   
   >> @echo off   
   >>   
   >> pushd "c:\folder" && FOR /F "skip=25 delims=" %%a IN ('DIR /B /AD /O-D') DO   
   echo RD /S /Q "%%a"   
   >>   
   >> pause   
   >>   
   >>   
   >>   
   >>   
   >>   
   >> Remove the echo to let it delete the folders.   
   >   
   > That didnt work...   
   >   
      
   Did you see anything on the console?   
      
   What part failed?   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca