[OPLINLIST] renaming vast numbers of file names

Chad Neeper cneeper at level9networks.com
Tue Apr 19 15:37:22 EDT 2016


More specifically to your situation:

@Echo on & SetLocal EnableExtensions
For /F "tokens=1,2,3* delims=-" %%I IN ('dir /b ??-??-????') DO rename
"%%~I-%%~J-%%~K" "%%~K-%%~I-%%~J"

Make a test folder and copy a small sample of the files you want to rename
into the test folder. Then copy/paste the above two lines into Notepad and
save it as a text file named something like "bulkrename.bat" or some such
in the same test folder. From the console, run your bulkrename.bat (or
whatever) script and see if it works as expected. If so, run the batch
script against your other filenames.

This exact script will likely only work if your filenames are exactly in
the format you specified. ie:  MM-DD-YYYY
NOT "M-D-YYYY"  or "MM-D-YYYY" or "M-DD-YYYY" or "MM-DD-YYYY-description"
or "MM-DD-YYYY.jpg" or anything else. If your filenames are other than what
you stated, you'll probably need to modify the script accordingly.


Of course, YMMV, disclaimers, and all other warnings apply here.
Naturally, you've backed up your files before subjecting them to potential
mass destruction. Right?


FWIW, I pulled this particular FOR command from
http://lurnedtoday.blogspot.com/2013/03/batch-rename-of-folders-in-windows.html.
For some insight into how it works, you can check out the link. I modified
the command to work with filenames and not folder names as used by the
author.

More FWIW, my quick and dirty Google search for a more relevant-to-you
script was:
https://www.google.com/search?q=bulk+rename+files+windows&oq=bulk+rename+files&aqs=chrome.1.69i57j0l5.7654j0j7&sourceid=chrome&ie=UTF-8#newwindow=1&q=bulk+rename+files+%22MM-DD-YYYY%22+to+%22YYYY-MM-DD%22



HTH and good luck,
Chad


______________________________
*Chad Neeper*
Senior Systems Engineer

*Level 9 Networks*
740-548-8070 (voice)
866-214-6607 (fax)

*Full IT/Computer consulting services -- Specialized in libraries and
schools*

On Tue, Apr 19, 2016 at 3:08 PM, Chad Neeper <cneeper at level9networks.com>
wrote:

> No, not impossible at all. Powershell can no doubt handle it, with a
> little careful programming. Even the normal Windows console might be able
> to handle it with a little creative scripting. However, if you're not able
> to get your PS script the way you want it, perhaps you can make use of a
> Windows GUI tool instead. Bulk Rename Tool
> <http://www.howtogeek.com/howto/45646/bulk-rename-tool-is-a-lightweight-but-powerful-renaming-tool/>
> or a similar such tool might do the trick for you. I haven't used it
> myself, but it claims to support wildcards, variables, etc...what you'd
> need for your purpose.
>
> HTH,
> Chad
>
> ______________________________
> *Chad Neeper*
> Senior Systems Engineer
>
> *Level 9 Networks*
> 740-548-8070 (voice)
> 866-214-6607 (fax)
>
> *Full IT/Computer consulting services -- Specialized in libraries and
> schools*
>
> On Tue, Apr 19, 2016 at 2:12 PM, Gerry Vogel <gvogel at avonlake.lib.oh.us>
> wrote:
>
>> Is there any such utility or script that can do this?  Various experts
>> have no answer and a Windows Powershell script that was supposed to do the
>> job didn't.
>>
>> I just want to change thousands of file names that are dates in
>> MM-DD-YYYY to YYYY-MM-DD.
>>
>> Impossible, I guess.
>>
>> --
>> Gerry Vogel, MLIS
>> Assistant Director, Avon Lake Public Library
>> 32649 Electric Blvd. Avon Lake OH 44012 www.alpl.org
>> general phone: 440-933-8128 (x239) direct line: 440-933-7238
>> cell (and text): 440-714-7581 fax: 440-933-6406
>> *any opinions expressed are my own and not (necessarily, or yet) those of
>> ALPL*
>>
>> *Sign up for Email Blasts <http://4la.co/14TZCK> about upcoming library
>> events.*
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> OPLINLIST mailing list -- OPLINLIST at lists.oplin.org
>> http://lists.oplin.org/mailman/listinfo/oplinlist
>>
>> http://aboutbooks.info -- Search for author, title, subject... anything
>> about books.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oplin.org/pipermail/oplinlist/attachments/20160419/4192e0ee/attachment.html>


More information about the OPLINLIST mailing list