Renaming file without extra extension at the end...
Posted: 18 Dec 2009 19:56
Hey all,
I am trying to make a batch file that renames a certain file type to another.
I know that if I do:
for %%a IN (*.<file extension>) DO rename "%%a" "%%a.<new file extension>"
The file will be renamed but it will have its original name with the extension along with the new extension.
For example, "Test.txt" will be renamed to "Test.txt.zip" if the command was:
for %%a IN (*.txt) DO rename "%%a" "%%a.zip"
Is there a way i could just take the name of the file and then add the extension so that "Test.zip" shows up instead of "Test.txt.zip"?
Help would be appreciated!
I am trying to make a batch file that renames a certain file type to another.
I know that if I do:
for %%a IN (*.<file extension>) DO rename "%%a" "%%a.<new file extension>"
The file will be renamed but it will have its original name with the extension along with the new extension.
For example, "Test.txt" will be renamed to "Test.txt.zip" if the command was:
for %%a IN (*.txt) DO rename "%%a" "%%a.zip"
Is there a way i could just take the name of the file and then add the extension so that "Test.zip" shows up instead of "Test.txt.zip"?
Help would be appreciated!