How can I remove the first character from all filenames in a folder?

again, try powershell ;)

Run this in your desired directory:

get-childitem *.txt | rename-item -newname { [string]($_.name).substring(1) }

Explanation:
- get-childitem *.txt collects all *.txt-files in the actual directory.
- rename-item -newname renames the piped results from the get-childitem command with the string that is generated in {}
- [string]($_.name).substring(1) takes the filename starting after the first character


Forget about complicated scripts for this.

rename is a very old and never properly completed command.  If you do not use it properly, the result might surprise you.

For example to remove a prefix abcd from abcd1.txt, abcd2.txt, abcd3.txt etc. in order to get 1.txt, 2.txt, 3.txt simply use

rename "abcd*.txt" "////*.txt"

You need the same number of / as the number of initial characters you would like to remove.  So, for your specific situation, you would use

ren "_*.txt" "/*.txt"

Do use double quotes for both arguments.


If you want to avoid having to write anything, try the Bulk Rename Utility. The interface can be quite scary at first but just have a play around with it and you'll see it's not actually hard to use at all.


Just if anyone needs in future: I use 1-4 rename. It is fast, does not have to be installed. When you run it hit F2 for advanced mode and you can tell it to kill the first 4 characters. Below is the link to the program.

Download Link: http://www.1-4a.com/rename/


in 2020 I had the same bulk rename problem: Remove fixed string of random characters for a lot of names.

Used this code in the Command Promt:

Rename "?????*.*" "*/////*.*"

(Remove any 5 characters) (You have tu use ")

Work perfet, thanks guys from de past.