I'm looking to make a batch file that will remove specific prefixes from files within a folder.
eg. Rename "1 File1.txt" and "1 File2.txt" to File1.txt & File2.txt respectively. The problem is that that the length of the prefix can vary. Here is the code I have:
@echo off
Set /p Prefix = Enter the prefix to eliminate:
rename "%Prefix%*.txt" "//*.txt"
Is there a way to make the amount of slashes (characters to remove) equivalent to the amount of characters entered by the user? Or another way to achieve the same thing?
Edit: Accidentally listed the files as "1 File1.txt and 2 File2.txt" - this was meant to be "1 File1.txt and 1 File2.txt" - all files with the same prefix (in this case, the prefix simply being "1 "