I have done some more modifications to suit my purpose, which was to rename the files to include the folder path it had.
here's the code for it
parentpath := RegExReplace(A_LoopFileDir,"\\","-")
;StringReplace, parentpath, A_LoopFileDir, \,-,All
newname = %parentpath%-%A_LoopFileName%
If a_loopfiledir <>