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,751 of 68,980   
   Peter to Peter   
   Re: Strange Batch Fil Problem & Fix   
   15 Jul 21 17:22:05   
   
   From: pmokover@gmail.com   
      
   On Wednesday, July 14, 2021 at 10:19:05 AM UTC-4, 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 fix: in the top line and the bottom line I changed “wait-Z” to   
   “wait ZZ”    
   >    
   > The same thing happened elsewhere in the batch file with “wait-O” which   
   I had to change to “wait-OO”. The problem does NOT happen with   
   “wait-N”, “wait-P” or “wait-Y”.    
   >    
   > I’m just trying to understand what’s wrong with “wait-Z” and why   
   “wait-ZZ” works fine.    
   >    
   > Possible clue: this happens on only one of my PCs. It’s a new one I built   
   about two weeks ago. All else seems to be normal with it. Windows 10 Pro   
   64bit.    
   >    
   > Thanks!   
      
      
   Thank you to those who replied!  Let me clarify a couple of things. 1) The   
   counter is not the problem.  It's working fine.  2) The problem is caused by   
   the bottom line shown above.  The batch file terminates when it hits that   
   line.  If I change it from "   
   wait-Z" to "wait-ZZ" there's no problem.  I hope this clarifies the issue.   
      
   --- 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