changing file estensions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have lots of files that I want to add an extension to. Rather than add an
extension to each individual file, is there a was to add extensions to a
large number of files at the same time?
 
Gelatojoe said:
I have lots of files that I want to add an extension to. Rather than add an
extension to each individual file, is there a was to add extensions to a
large number of files at the same time?

Here is how you can do it. The method assumes that none
of the files in the chose folder have an extension.

1. Click Start / Run / cmd {OK}
2.. Type these commands:
cd /d "%SystemRoot% {Enter}
notepad extension.bat {Enter}
3. Enter these lines:
@echo off
dir /b /a-d > c:\dir.txt
for /F %%a in (c:\dir.txt) do echo ren "%%a" "%%a.xxx"
(replace xxx with the desired extension)
4. Save the file but do not close it.
5. Type these commands:
cd /d "Q:\Some folder\Some Subfolder"{Enter}
(replace Q: with the drive letter for your folder
and use the correct folder and subfolder names)
extension.bat{Enter}

The last command shows you what ***would*** happen if
you activated the batch file you just wrote. To activate it, make
the last line like so:
for /F %%a in (c:\dir.txt) do ren "%%a" "%%a.xxx"
then run it again by typing extension.bat {Enter} at the Command
Prompt.

To rename files in other folders, simply run Steps 1 and 5.

Warning: Do not run this batch file more than once. If you run
it twice then you will get two extensions, and three if you run
it three times . . .
 
Gelatojoe said:
I have lots of files that I want to add an extension to. Rather than add
an
extension to each individual file, is there a was to add extensions to a
large number of files at the same time?

XYplorer (shareware file manager, 30-day free trial) makes it easy: use
command "Set Extension..." to add an extension (or change an existing
extension) to any number of files in a blink.

http://www.xyplorer.com/

Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top