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,745 of 68,980   
   JJ to Peter   
   Re: Strange Batch Fil Problem & Fix   
   15 Jul 21 13:04:08   
   
   From: jj4public@gmail.com   
      
   On Wed, 14 Jul 2021 07:19:03 -0700 (PDT), Peter wrote:   
   > I was updating a batch file I wrote to backup one of my PCs.  It kept   
   > crashing at a certain point.  For two days I tried various things to fix   
   > it with no luck.  I finally guessed at a fix which does work but I don¢t   
   > understand what the problem was or why the fix works.  Here are a few   
   > lines from the batch file showing the original version.   
   >   
   > (It¢s basically a counter/timer loop.  When the counter hits 5 seconds it   
   > exits the loop and continues elsewhere in the batch file.  It¢s the   
   > bottom line that caused the crash.)   
   >   
   > =================================   
   >:wait-Z   
   > if %counter%==5 goto Start-N   
   > timeout 1 > nul   
   > set /A counter=%counter%+1   
   > if not exist z:\transfer\batch goto wait-Z   
   > =================================   
      
   The `if` command would generate a syntax error if `%counter%` is   
   empty/blank.   
      
   --- 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