Why doesn't it work?
For one thing, %a% is undefined.
Sorry for being rude before.
The OP does not seem to understand the difference between:
one-sided loop variables, which can be (officially) %%a to %%z and %%A to %%Z, that is (in a batch) two percent signs %% followed by a single character, which only exist within the loop, and
two-sided ordinary variables which are created using set, e.g. set file=C:\test\readme.txt, and expanded using a percent sign before and after e.g. echo %file% or type %file% or copy %file% d:\folder. These names can be any (reasonable) number of characters in length (I expect there is some kind of system limit but it is not obvious what this is). They exist throughout the batch file. Special conditions apply in loops for double sided variables but I shall not go into that here.