|When you enable the Delayed Expansion you must mark the environment variables by ! instead of the usual %, i.e.|
set /A Counter=0
for %%x in (%1) do (
ren "%%x" "myPictureNumber!Counter!.%2"
set /A Counter+=1
and use for without the /R switch to select the files in the folder since /R forces another behavior (see for /?).