Tech Support Forum banner

cmd command lines: how to batch rename files in a sequencing order???

4935 Views 3 Replies 2 Participants Last post by  sobeit
For example, in d:\, I have got three txt files:

a.txt
b.txt
c.txt

How can I rename them in batch like this:

file1.txt
file2.txt
file3.txt

I know I can do it in Windows Explorer by selecting all the files, pressing F2 and typing "file (1)" and this produces similar file names (though it is not file1 but file (1))
But I wanna know how I can do it in a bat file.

Could anyone who knows it help me? Many thanks!!!
Status
Not open for further replies.
1 - 2 of 4 Posts
its been a long while since I did it but try using wildcards for file name.

ren *.* file.txt
Thanks for that. But,
It only changes a.txt to file.txt while the other two remain the same.And,
it does not rename a.txt to file1.txt.
How can I make it?
1 - 2 of 4 Posts
Status
Not open for further replies.
Top