I found this:
How to loop over environment variables in windows batch file?
which is almost what I search for. But in my case, the variables to expand sometime