[windows2000] Multiple arguments in a batch

  • From: "Costanzo, Ray" <rcostanzo@xxxxxxxxxxx>
  • To: "'windows2000@xxxxxxxxxxxxx'" <windows2000@xxxxxxxxxxxxx>
  • Date: Mon, 9 Sep 2002 15:58:45 -0400

Hi list,

I'm writing a batch file that will expect some arguments.  The number of
arguments can vary, however.  Like, someone may enter any of these three
things, for example:

file.bat Arg1 Username Password Date1 Date2 Date3 Date4
file.bat Arg1 Username Password Date1
file.bat Arg1 Username Password

What I want to do would essentially be:
Set Arg1=%1
Set User=%2
Set Pass=%3
Set Dates=%TheRest

Does anyone know how I can get the rest?  I know I can use %* for everything
or %[number] for a specific argument, but is there a way to grab all
arguments beyond #3 and stick them in one variable?


Ray at work

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


To Unsubscribe, set digest or vacation
mode or view archives use the below link.


Other related posts: