Re: Add number to file name in order of file date in dos


[ Follow Ups ] [ Post Followup ] [ The EasyDOS Forum ] [ FAQ ]

Posted by Valerie on February 01, 2009 at 19:20:57:

In Reply to: Add number to file name in order of file date in dos posted by lee on January 31, 2009 at 00:15:41:

Here's just one way of renaming files, not tested, for Win XP command prompt only.

:: Code begins.....
@echo off
cls
dir /tw/b/od "foldername\*.* > %temp%\dirfile.txt

for /f "delims=*" %%A in (%temp%\dirfile.txt) do (
set filnam=%%A
call :output
)

cls
set nbr=
exit /b

:output
set/a nbr +=1
ren "foldername\%filnam%" "%nbr%%filnam%"
goto :eof
:: Code ends....


Follow Ups:



Post a Followup (use TAB key to move between boxes - NOT ENTER or RETURN)

Name:
E-Mail:

Subject:

Type your comments in the box below and SUBMIT:


[ Follow Ups ] [ Post Followup ] [ The EasyDOS Forum ] [ FAQ ]