Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Dear all,
I am having a trouble. I try to use the content of a variable as the name of a variable, in a loop.
When I do the following outside a loop, it works :
SET VAR_1=DONNEE SET ITR=VAR SET ACC=%ITR%_1 echo %ACC% >> access.log echo !%ACC%! >> access.logThe last line actually prints out the content of VAR_1.
But when I try to put it into a loop it fails since I can not use the '%' character.
FOR /D %%g IN (*) DO ( SET BROL=%%g SET TMP_SCH=!BROL!_SCH SET TMP_USR=!BROL!_USR SET TMP_PWD=!BROL!_PWD echo !!TMP_PWD!! >> access.log )The last line prints out the name the variable and not its content.
Does anyone have an idea to help me solve this problem ?
Best regards

![]() |
Window Problem
|
Script for running backup...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |