Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Batch program for natural to 7-digit file name conversion? (Miscellaneous)

posted by Torsten(R), 28.06.2017, 13:29

> @ECHO OFF
> REM Batch file 00RENAME June 9, 2017 by Tom E., renames files using natural
> REM numbers as names (1, 2 ... 999999) to file names with leading zeroes
> REM (0000001, 0000002 ... 0999999). Helps to overcome different ordering
> REM conventions when transferring data from one program to another. Caution:
> REM in the current directory, any file without an extension will be renamed.
> FOR %%i IN (?) DO ren %%i 0%%i
> FOR %%i IN (??) DO ren %%i 0%%i
> FOR %%i IN (???) DO ren %%i 0%%i
> FOR %%i IN (????) DO ren %%i 0%%i
> FOR %%i IN (?????) DO ren %%i 0%%i
> FOR %%i IN (??????) DO ren %%i 0%%i
> FOR %%i IN (???????) DO ren %%i 0%%i
> ECHO ON

Works perfectly, Tom, thank you!
In this particular case, it is even unnecessary to move index and tag
files into another directory: they use file extensions and your batch thus
doesn't affect them (folder's contents must be re-indexed later, anyway).
Regards, Torsten

 

Complete thread:

Back to the forum
Board view  Mix view
15155 Postings in 1361 Threads, 250 registered users, 19 users online (0 registered, 19 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum