you need the loop to run once for each individual file... you cant rename *.jpg to *%pa.jpg as itll try n call em all the same name (what PA is currently set to) and it wont update PA everytime
so command needs to run once, then update pa, then run again etc. etc. etc. untill you if exist command stops finding things existing and stops the batchfile running