Perfect! I hadn't come across @runonce yet.
By the way, in case you haven't noticed: If you enter "01" as the starting number, Rename uses leading zeros and produces 01, 02, ... 10, 11 instead of 1, 2, .. 10, 11.
It might be worth sticking a [#] in the new filename (i.e. the TO argument) to explicitly say where the number should be inserted, otherwise existing numbers (if any) in the filename may be replaced.
I think it's more of the @set variable that did it. You can remove the @runonce: from each line and it still works. (Also added Leo's suggest for [#])
@set filename={dlgstringS|Rename to:|{file$|noext}}
@set startnum={dlgstringS|First Number Begings with:|001}
@set numby={dlgstringS|Incrementing By:|1}
Rename PATTERN ".*\.(.*)" TO "{$filename} [#].\1" NUMBER {$startnum} BY {$numby} REGEXP
@nodeselect
I'm not really sure what it all means. I just took some ideas from another button and it worked (idk, I'm not a programmer). Leo didn't point out that @runonce: was wrong, so maybe it's ok to leave it. As long as it works, right?
Yes, I prefer 001 but your sample showed 1 so I left it at that
Runonce shouldn't be needed, but may be (or may have been in the past) in some cases to workaround some quirk. If it works without it then leave it off, but equally it shouldn't cause any problems either.