Batch file to remove suffix from files?


Recommended Posts

I have a bunch of files named "document (1).doc", "movie (1).avi", etc. How do I make a batch file remove the " (1)" from all the files?

I've tried getting rid of the (1) using this:

rename *(1).avi *.avi[/CODE]

That doesn't do anything. I'd like to have a .bat or some other kind of script that I can run manually or using task scheduler.

I don't think the Windows command shell is quite advanced enough to do that; Powershell may be but I've never really used it.

You can use a free GUI program like this though: http://www.den4b.com...product=renamer

By the way, the (1) appears in the first place because a file with that name already exists.

I don't know if this tool would help you at all, but I wrote it to do a similar thing :)

https://www.neowin.net/forum/topic/996768-i-wrote-a-batch-file-renamer/

It's pretty much does what yxz is doing but in C#. Hope it helps >.<

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.