I have been trying to replace a part of some file names in a directory to new names. I have found many examples regarding this replacement using REN command with a for loop.
Example: if I want to replace test001 to test003, I can replace using REN.
But what,if I take 001 and 003 as user input through set \p command and I want the output to be test003, for the input test001.
I have the following files in my folder:
Test001.txt
user001.txt
fjkdjdl001.txt
I want to convert them to
Test0003.txt
user003.txt
and so on.
But 001,003 are user inputted.
How for+ren act with user inputted characters.Please help me.
ren *%src%*%dest%` wheresrcanddestare input from aset /p src=...andset /p dest=...codeREN "*%src%.sh" "*%dest%.sh" acc' to what you suggested and my src=991 and my dest=998.Initially my filename was Test991.sh but now,its test9998.sh.why is this extra 9 coming and where from it is coming?Iam surprised.And How can I remove this character which is appearing in some filenames?Please help.