home bbs files messages ]

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

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

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

   Message 67,801 of 68,980   
   Herbert Kleebauer to Mike NYC   
   Re: Batch File change   
   17 Oct 21 00:41:01   
   
   From: klee@unibwm.de   
      
   On 16.10.2021 19:18, Mike NYC wrote:   
      
   > I have a simple search, copy, move batch file   
   > I only does "todays" files...   
   > Suppose I need yesterdays or 2 days ago or 3 etc etc   
   > what would I change in here:   
   >   
   > del c:\todayhtr\*.* /q   
   > set filestocopy=c:\htr\%DATE:~4,2%%DATE:~7,2%*.*   
   > copy %filestocopy% c:\todayhtr   
      
   The simplest way would be to specify the date and not the   
   offset to the current date:   
      
   del c:\todayhtr\*.* /q   
   set filestocopy=c:\htr\%1*.*   
   if [%1]==[] set filestocopy=c:\htr\%DATE:~4,2%%DATE:~7,2%*.*   
   copy %filestocopy% c:\todayhtr   
      
   If you start the batch without a parameter the current date is used   
   otherwise the given date is used.   
      
   But if you really want to calculate yesterdays date within the batch,   
   read the thread "Get date of recent weekday" from a few weeks ago.   
      
   --- 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