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 40,707 of 42,547   
   Todd Vargo to blinkingblythe01@gmail.com   
   Re: Enviroment variables not staying aft   
   26 Jul 13 17:44:15   
   
   From: tlvargo@sbcglobal.netz   
      
   On 7/26/2013 12:26 AM, blinkingblythe01@gmail.com wrote:   
   > On Thursday, July 25, 2013 4:08:15 AM UTC-7, Todd Vargo wrote:   
   >> On 7/25/2013 1:06 AM, blinkingblythe01@gmail.com wrote:   
   >>   
   >>> Under Dosbox and MsDos, the counter works fine. Under windows XP's   
   >>   
   >>> command com, the counter refuses to go past 1. The batch file is not   
   >>   
   >>> keeping the "count" variable updated once it leaves and a look at set   
   >>   
   >>> shows the count variable isn't even in the environment. I'm not using   
   >>   
   >>> command /c or anything to call the file, just the batch files name.   
   >>   
   >>> Does anyone know what is going on here?   
   >>   
   >>   
   >>   
   >> You may not be providing enough information about your particular usage.   
   >>   
   >> You are not exactly clear about what you mean by "once it leaves". The   
   >>   
   >> batch appears that it was intended to recall the last count after a   
   >>   
   >> reboot of a DOS system. In a command window the value is lost when the   
   >>   
   >> window closes. For further help, give complete details about what the   
   >>   
   >> batch is intended to do and how it is used.   
   >>   
   >   
   > It is supposed to count up a number every time it is run (the user   
   > types countbat at the dos prompt)   
   >   
   > example:   
   >   
   > c:\countbat 1 c:\countbat 2 c:\countbat 3 etc.....   
   >   
   > Unfortunately, it stays at one. I keep the command window open, but   
   > the value is still lost when the batch file exits even though the   
   > command window is still open. Its behaving like i am using command /c   
   > to call it but this is not the case.   
   >   
      
   Sorry, like foxi, when I remove the trailing spaces, and the batch is   
   run multiple times in the same command window, the counter works   
   correctly for me. The count and count2 variables remain set between runs   
   until the window is closed. Taking a guess, either you have missed a   
   trailing space somewhere, or the code that you are using is somehow   
   different from what was posted, or there is some important detail   
   missing (like perhaps you have a setlocal at the top of your batch that   
   was not included in your post).   
      
      
   --   
   Todd Vargo   
   (Post questions to group only. Remove "z" to email personal messages)   
      
   --- 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