Op Thu, 09 Aug 2012 05:36:37 +0200 schreef inetquestion
<
inetqu...@hotmail.com>:
> when running the command below such as: test.bat res*stu*.pdf
> Why does the for loop set the value of XXX, but in the next for loop it
> fails to set the value of 'attachment'?
> ============
> @echo off
> set XXX=
> set attachment=
> touch "resilxxoo stuff.pdf" <= is touch a util? internal cmd?
> for %%I IN (%1) do set XXX="%?%I" <= needs quotes? needs single % ?
> (quotes to enforce full names?)
> echo Attachment-A: %XXX%
> ::::::::::::::::::::::::::::::::::::::
> :: Process command line params
> ::::::::::::::::::::::::::::::::::::::
> :while
> IF "%1" == "" ?(GOTO wend)? <= needs brackets? needs then ?
> If /I "%~x1" == ".pdf" ( <= whats this
> var?
> for %%I in (%1) do set attachment="%?%I" <= needs
> quotes? needs single % ?
> echo 1: %1
> echo Attachment-B: %attachment%
> shift
> )
> @GOTO while
> :wend
>>> ms-dos has been awhile - just commenting <<<
--
Gemaakt met Opera's e-mailprogramma:
http://www.opera.com/mail/