WORKS...
Thanks a lot.
Can you explain me why i have to double all %?
It's to do with the way the command interpreter expands variables. Using a percent sign (%) in a batch file requires that two percent signs (%%) be specified.
For example, the command to display "5%" from a batch file would be :
ECHO 5%%
A single percent sign on a line is treated as a "nul" character in a batch file. For example:
ECHO % is processed as ECHO
ECHO a%b is processed as ECHO ab
If a command contains two percent signs, the command interpreter will treat any characters between them as an environment variable to be expanded. For example, if the SET command shows that the current environment variables are
COMSPEC=C:\COMMAND.COM
PATH=C:\DOS
PROMPT=$P$G
B=C
then
ECHO %PATH% is processed as ECHO C:\DOS
ECHO a%b% is processed as ECHO aC
ECHO a%b b%a is processed as ECHO aa
If there are no characters between the two percent signs, one percent sign is stripped off and the other will remain. This is why a FOR command that echos the name of each file with a .COM extension would be
FOR %V IN (*.COM) DO ECHO %V
but if the same command is placed in a batch file, the following is required:
FOR %%V IN (*.COM) DO ECHO %%V