From: gazelle@shell.xmission.com   
      
   In article , R.Wieser wrote:   
   >Hello all,   
   >   
   >I've got a batchfile in which I use the first (%1) argument as a switch to   
   >decide which program should be started with the remaining arguments.   
   ...   
   >Question:   
   >How do I provide all arguments starting from the second one to the program ?   
   >   
   >Currently I just use "program.exe %2 %3 %4 %5 %6 %7 %8 %9" and be done with   
   >it, but would like to know a way to provide more than 9 arguments to the   
   >batchfile and still have it work.   
      
   I've hit this myself, long ago. I think it is just a limitation of DOS   
   batch that we all have to resign ourselves to living with.   
      
   There are quite a few alternatvies to plain DOS batch at this point in   
   time, so you could switch languages. I know this isn't what you want to   
   hear, of course.   
      
   In particular, it is amazing how much better of a scripting language bash   
   is, compared to plain DOS batch. You could write in bash and run it under   
   Cygwin (or similar)...   
      
   Or you could do something like:   
      
   set prog=%1   
   shift   
   set args=   
   :loop   
   if not %1X==X (   
    set args=%args% %1   
    shift   
    goto loop   
    )   
   %prog% %args%   
      
   --   
   When polled for who is/was the worst US president, the candidates (i.e.   
   popular responses/suggestions) are usually:   
    (Andrew) Johnson, Buchanan, or Trump   
   When polled for who is/was the best US president, the candidates (i.e. popular   
   responses/suggestions) are usually:   
    FDR, Lincoln, or Trump   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|