Re: Renaming multiple files???



On Fri, 08 Aug 2008 16:18:47 -0700, Jim Thompson
<To-Email-Use-The-Envelope-Icon@xxxxxxxxxxxxxxx> wrote:


I need to rename multiple files, as for example...

DSC00062.JPG
|
|
|
DSC00098.JPG

to...

Thanksgiving00062.JPG
|
|
|
Thanksgiving00098.JPG

I vaguely remember, in DOS, that I could type:

REN DSC*.JPG NAME*.JPG

But that won't handle long files names, plus it's a pain dropping into
the crappy DOS window.

Anyone know a trick or a utility (doesn't have to be free) that can do
this?

Thanks!

...Jim Thompson

Can't use the DOS ren command unless the wildcard before and after is
the same number of characters. All modern DOS commands will handle
long file names, so no problem there. In fact, the new batch commands
starting with NT are much slicker than the old days, but not as good
as Unix.

What I do is drop to command line window (a couple clicks with my
nifty batch file).

I make a batch file with all the file names in the directory by doing
this:
dir /b *.jpg > zit.bat

Edit zit.bat with a text editor that has macros and make each line
look like this:
ren DSC00098.JPG Thanksgiving00098.JPG
The key to making this workable is creating a macro to modify each
line.

Run the batch file and all the files will be renamed.

Now, for my nifty way of using "Send To" to drop you in a command line
window in the proper directory in a few clicks. This uses the newer
batch commands that were available since NT. Create the following
4-line batch file. I named mine DosStart.bat .

@echo off
%~d1
cd %~p1
cmd

Put DosStart.zip in a directory that's in your searchable path. I
stick all my handy batch files in my Tools directory, but you could
put this in your system32 directory.

Make a shortcut in your SendTo directory
(C:\Documents and Settings\UserName\SendTo) which points to
DosStart.zip. To see the SendTo directory, you need to set Hidden
Files and Folders to visible in Explorer (Tools|Folder Options|View).

To use this handy batch file, in Explorer, navigate to the desired
directory. Right click on any file, select Send To, and click on the
DosStart icon. Presto, a command line window opens and you're sitting
in the directory that Explorer is sitting in.

--
Mark
.



Relevant Pages

  • Re: Unable to delete
    ... any files that may be in the folders. ... If there are any files, use the Attrib command to remove any Hidden, System or Read-only attributes that may have been set for them. ... Maybe it's Windows Explorer itself that is blocking the deletion; be sure it is focused on some other folder before you open the "DOS" window. ...
    (microsoft.public.windows.file_system)
  • Re: Multi-zip files -- Windows server
    ... native DOS versions). ... TO BATCH OR NOT TO BATCH ... and using a batch file to try and solve the problem... ... The IBM PC operating system command line is a most ...
    (comp.sys.cbm)
  • Re: batch question
    ... window at great speed, without being executed. ... all I want is for the command to work inside a command prompt window. ... Your original batch file had two lines. ... you fell into a well-known trap: you are not executing ping.exe ...
    (microsoft.public.windowsxp.general)
  • Re: Batch File Problem - Batch File Enclosed
    ... I have added a batch file to my Startup folder to execute whenever ... The batch file works ok but it leaves a blank command ... I would like close this window using the batch file ...
    (microsoft.public.windowsxp.general)
  • Re: Execute a batch file and wait for it to complete
    ... and until I manually close the console. ... Starts a separate window to run a specified program or command. ... If it is an internal cmd command or a batch file then ...
    (comp.lang.fortran)