Tech Support Forum banner
Status
Not open for further replies.
1 - 4 of 4 Posts

· Registered
Joined
·
11 Posts
Discussion Starter · #1 ·
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!!!
 

· Premium Member
Joined
·
20,007 Posts
its been a long while since I did it but try using wildcards for file name.

ren *.* file.txt
 

· Registered
Joined
·
11 Posts
Discussion Starter · #3 ·
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 - 4 of 4 Posts
Status
Not open for further replies.
Top