General discussion

Locked

rename files

By rhiegen ·
Suppose I have many files which names are like:

990323 sth sth
990568 sth sth
990898 sth sth

suppose there are thousands of files like that. These are in a folder and I would like to rename them, not one by one, but automatically to something like:

995323 sth sth
995568 sth sth
995898 sth sth

I mean, replacing "0" by "5" in the middle of the first part of these names. Remember the files name are longer names of Windows.
How could I proceed to the name changing of these files, without having to make it one by one thousands of time by hand.
I accept any suggestion including using delphi or any other resource of the Windows.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

rename files

by ajg In reply to rename files

You can accomplish what you want to do using the DOS ren command. (I made up as set of dummy files (5) and tested it.)
Start/Programs/MS-DOSprompt
Change to the folder containing the files.

ren ???*.* ??5*.*

This assumes you want 5 in the 3rd position of all file names.
For your files they will appear similiar to 990323~1, etc. I used names like yours and it worked fine.
The above technique will work to change and of the first 6 positions.

Collapse -

rename files

by rhiegen In reply to rename files

The question was auto-closed by TechRepublic

Collapse -

rename files

by ruturaj In reply to rename files

The above solution will work with 8.3 filenames or the first 6 characters of long file names if you want to go a step further use "" to enc your file names
eg.

ren "99????*" "99????X*"
The above statement will replace the space (sixth character) with the letter X you can use the wildcard character ? till any number of character that you actually want to replace.

(If you have the actual file names and the character you want to replace send it to me & I'll write a batch file to do the same and e-mail it back to you)

Regards :)

Collapse -

rename files

by rhiegen In reply to rename files

The question was auto-closed by TechRepublic

Collapse -

rename files

by rhiegen In reply to rename files

This question was auto closed due to inactivity

Back to Windows Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums