Try the ExecuteCmd procedure in SAM and then use windows / CMD logic.
Or use AutoShell (a third party tool to do just the same thing in older SAM).
If you just want to Rename files but not move them, use the RemameFile PAL command.
There's also another option to use the database to perform your rename / move needs, but that should only be considered if you're already familiar with your database system and it's stored procedures programming language (that option is only available for MySQL/MariaDB, Postgres and MS SQL as a database system, but not for Firebird embedded). That's more of an option if you're a DB Engineer by trade and only do SAM as a hobby, though. Not exactly the stuff mere mortals would do or want to learn. (Can't really help with that option myself from the top of my head and am currently not willing to go diving into the documentation of the database for that unless someone was paying very good money, so consider that just for the sake of completeness