Batch Rename Special-Saving Command

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
TestMeister
Posts: 249
Joined: 04 Feb 2008 20:17
Location: Win 11 Pro v25H2- 125%

Batch Rename Special-Saving Command

Post by TestMeister »

I would like to be able to select one or more files, and by selecting a user-defined function, have characters added as a prefix:

ThisIsATest.txt >>> P-ThisIsATest.txt

The Rename Special function will do this but I don't see a way to save a given command so it will persist in the context menu.

I thought perhaps a short script assigned to a UDF button; can anyone assist with the script command?

Many thanks!

highend
Posts: 14956
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Batch Rename Special-Saving Command

Post by highend »

Scripting commands needed:
get
rename
and a foreach loop...

Look in the scripts exchange part of the forum, Stefan, PeterH, myself and a few others have posted dozen of script (snippets), that use these commands for comparable issues.
One of my scripts helped you out? Please donate via Paypal

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Batch Rename Special-Saving Command

Post by Stefan »

TestMeister wrote:I would like to be able to select one or more files, and by selecting a user-defined function, have characters added as a prefix:

ThisIsATest.txt >>> P-ThisIsATest.txt

The Rename Special function will do this but I don't see a way to save a given command so it will persist in the context menu.

I thought perhaps a short script assigned to a UDF button; can anyone assist with the script command?

Many thanks!
If you have an working rename command, you can add it as User-defined Command (UDC) too.
And then you can add even an keyboard shortcut.


.

stapelt
Posts: 1
Joined: 30 Jul 2012 05:58

Re: Batch Rename Special-Saving Command

Post by stapelt »

Using the Rename Special->RegExp Rename
Code is: ^(.*)$ > PreFix-$1

This is what I use and it works on all the selected items.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Batch Rename Special-Saving Command

Post by TheQwerty »

stapelt wrote:Using the Rename Special->RegExp Rename
Code is: ^(.*)$ > PreFix-$1

This is what I use and it works on all the selected items.
FYI: you can shorten that to just:

Code: Select all

^ > Prefix-

Post Reply