Computing.Net > Forums > Windows 2000 > Rename file by date format

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Rename file by date format

Reply to Message Icon

Name: swwong
Date: July 14, 2004 at 18:32:16 Pacific
OS: Windows 2000
CPU/Ram: P4/512 Ram
Comment:

Hello

How can I rename file by date format?

I try use this batch which can work in Windows XP, but it cannot work in Windows 2000 Server. Please Help Me.

Rem Get Day,Mth & Year from %Date%
set Day=%Date:~0,2%
set Mth=%Date:~3,2%
set Yr=%Date:~6,4%
ren d:\backup\backupdata.zip %Yr%%Mth%%Day%.zip


THX

swwong



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: July 15, 2004 at 06:02:54 Pacific
Reply:

Hi sw,

###################################
@echo off > quit.bat
@echo echo %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9 >> quit.bat

echo.
echo This is the world famous %0.bat
echo.
echo copyright 2004 ThaiGuides.com All rights reserved
echo.
echo Free for private use. Others email: Consult@ThaiGuides.com
echo.
echo built and tested on windoze 2000; may act funny on other versions
echo.
echo. Purpose is to rename a zip to today's date

::*********************************************************************

if %1'==' quit syntax: %0 filename to rename

ren "%1" "%DATE%.zip"
#######################

If you need the

YrMthDay

layout, let me know and I'll tweak it.

M2



0
Reply to Message Icon

Related Posts

See More


Device DELETED outlook runtime error



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: Rename file by date format

Rename Files by Time/Date Stamp? www.computing.net/answers/windows-2000/rename-files-by-timedate-stamp/15657.html

Batch Deleting Files By Date www.computing.net/answers/windows-2000/batch-deleting-files-by-date/42236.html

Rename a file with date and time www.computing.net/answers/windows-2000/rename-a-file-with-date-and-time/58934.html