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 68,778 of 68,980   
   R.Wieser to All   
   Re: Use the remaining arguments ?   
   23 Apr 24 10:40:48   
   
   From: address@is.invalid   
      
   Herbert,   
      
   >> Would it make a difference if I told you that the exact "first" line is   
   >> "if   
   >> exist %1.ext goto DoExt" ?   
   >   
   > Yes.   
      
   Ah.  And what would that difference be ?   
      
   Mind you, your "call :%*" was quite nifty, but /very/ limited in its usage.   
      
   > If there are no poisoned characters like %^!& in the arguments,   
   > this should work:   
      
   Thats why I called batch'es string-handling finicky.  :-|   
      
   Its even worse worse : "^" and "%" collapse on the commandline, but only "^"   
   seems to collapse in each loop-step (I didn't really try the others).  And   
   both solutions you provided respond differently to the usage of the "^"   
   escape character.   
      
   > set p=&for %%i in (%*) do if defined p (call set p=%%p%% %%i) else (set   
   > p= )   
   > echo %p%   
      
   Thanks.  I never saw that "if defined p" before, so I've learned something   
   new. :-)   
      
   I think I have to conclude that removing the first argument (or more) from a   
   commandline isn't possible.  Not in a dependable way.   
      
   Regards,   
   Rudy Wieser   
      
   --- 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