diamond
Posts: 3000
Joined: Sun Apr 11, 2004 8:01 am

Windows File Rename Question

Tue Dec 05, 2006 11:14 am

I have a question about something that should be simple to do, yet it escapes me.

Let's say I want to rename all the files within a single folder so that they all start with something similar.

Example: I have a folder that contains 426 pictures of Boeing 777's. They are from various sources and the filenames are all different. I would like to rename them so that the current filename is preceded by "B777_".

106875.jpeg becomes B777_106875.jpeg, etc.

I know how to do this in DOS, from the command prompt. But navigating between folders is difficult that way.

Is there any way to do a global file rename using Windows Explorer?
Blank.
 
lehpron
Posts: 6846
Joined: Tue Jul 10, 2001 3:42 am

RE: Windows File Rename Question

Tue Dec 05, 2006 11:21 am

I almost want to suggest coding a small MATLAB or C++ program to open each file and add the extra text you want and set it up as a loop -- but that is probably not what you were thinking of.  no 
The meaning of life is curiosity; we were put on this planet to explore opportunities.
 
diamond
Posts: 3000
Joined: Sun Apr 11, 2004 8:01 am

RE: Windows File Rename Question

Tue Dec 05, 2006 11:27 am

Quoting Lehpron (Reply 1):
I almost want to suggest coding a small MATLAB or C++ program to open each file and add the extra text you want and set it up as a loop -- but that is probably not what you were thinking of.

I'm pretty capable as a Windows end-user, but I know nothing about C++.
Blank.
 
davestanKSAN
Posts: 1532
Joined: Fri Sep 23, 2005 3:32 pm

RE: Windows File Rename Question

Tue Dec 05, 2006 11:37 am

Here's what I got when I searched in Windows help

1. Start Windows Explorer. To do so, click Start, point to All Programs, point to Accessories, and then click Windows Explorer.
2. Select multiple files in a folder. To do so, press and hold down the CTRL key while you are clicking files.
3. After you select the files, press F2.
4. Type the new name, and then press ENTER.
NOTE: When you complete the preceding steps, the highlighted state of all files except one disappears, so it may appear as if you are only renaming one file. However, after you press ENTER, all of the files are renamed. When you rename multiple files, all of the renamed files have the same name with a number in parentheses appended to the name to make the new file name unique. For example, if you type BUDGET as the new name, the first file is named BUDGET. All of the remaining selected files are named BUDGET(x), where x is a unique number, starting with (1).

Notes
If you make a mistake when you try to rename multiple files, you can press CTRL+Z, or click Undo Rename on the Edit menu to undo file rename action you just completed, and you can repeat this process as needed.

The Rename function in Windows Explorer does not match the behavior of the REN command you may use at a command prompt. For example, if you had files that are named smitha.doc, smithb.doc, and smithc.doc, you could use the ren smith*.doc smythe*.doc command. All file names automatically show the new spelling, and are renamed smythea.doc, smytheb.doc, and smythec.doc.

If you use the Windows XP Rename function in Windows Explorer, after you select the three "smith" files, and rename smitha.doc to smythea.doc, all the other files you selected are named smythea(x).doc. To return to the original file name structure (the use of a, b, c, etc), you must rename each file individually.

Basically go to the folder, hit Ctrl A, then F2. It will look like only one file is selected but when you change the name of that file and press enter, all of the files will change.

Hope it helps.

Dave

[Edited 2006-12-05 03:39:31]
Yesterday we've sinned, today we move towards God. Touch the sky....love and respect...Safe Star!
 
j_hallgren
Posts: 1427
Joined: Sun Jun 04, 2000 11:48 am

RE: Windows File Rename Question

Tue Dec 05, 2006 12:17 pm

For that type of function, I would simply use IrFanView...as it has a batch rename ability...and it's free...and very handy for dealing with photo files, in terms of viewing, resizing, renaming, etc.
COBOL - Not a dead language yet!
 
damirc
Posts: 726
Joined: Fri Feb 13, 2004 8:43 am

RE: Windows File Rename Question

Tue Dec 05, 2006 1:12 pm

Well, from the command prompt - but still my preferred way of doing things...


for /f "tokens=*" %f in ('dir /b *.jpg') do ren "%f" "b777_%f"


D.

Who is online

Users browsing this forum: B737900ER, Ken777, WarRI1 and 12 guests