Code: Select all
[::
folderPath := "C:\Reprise\Steam\steamapps\common\Skyrim Special Edition\Screenshots"
Loop, Files, %folderPath%\*.png
{
FileMove, %folderpath%\%A_LoopFileName%, %folderpath%\Screenshot%A_Space%%A_Index%.png
}
exit
This is supposed to rename all png files in the folder to Screenshot 1, Screenshot 2, etc. Say there are 3 files. What will happen is first screenshot will be renamed "Screenshot 1", then second "Screenshot 2", then 3rd "Screenshot 3"... and then "Screenshot 1" will be renamed "Screenshot 4". It only happens for the first file renamed. Problem doesn't occur if I don't add "screenshot" to the name. So if it were FileMove, %folderpath%\%A_LoopFileName%, %folderpath%\%A_Space%%A_Index%.png I would get " 1.png", " 2.png", " 3.png" as expected.
What is causing this?