When entering a command manually it works fine, but when using that same command in a batch file it errors out. HOW to fix it has already been answered here, but I am wondering WHY you have to change things.
The linked example is that when using a for statement in a batch file, the variables need two percent (%) signs instead of one.
On the cmd line:
for %f in folder move ...
From a batch file:
for %%f in folder move ...