Solved Batch file to modify date and time stamp of files in Win 7

January 14, 2016 at 20:53:38
Specs: Windows 7
I have 500 files like on this example:

Name Date Modified
IMP59.10 1/10/2014 10:30 PM
IMP67.11 1/11/2014 11:23 PM

I want to rename them like shown below:

000320141001103004.IMP59
002320141101112304.IMP67

0003 is a code entered during batch execution respectively defined inside. Date and time in the format yyyymmddhhmmss

message edited by MK34


See More: Batch file to modify date and time stamp of files in Win 7

Report •


#1
January 15, 2016 at 05:15:04
You will need third-party software to alter the date and time stamp of files.

Report •

#2
January 15, 2016 at 11:51:37
It's possible with batch through string manipulation, but it's dependent on your regional date/time settings.

How To Ask Questions The Smart Way

message edited by Razor2.3


Report •

#3
January 15, 2016 at 16:44:08
✔ Best Answer
here's a batch based on your submitted file-date/time format:

::-------- begin batchscript DT.BAT
@echo off & setlocal enabledelayedexpansion
set code=%2
if "%1" equ "" (
echo Usage: %0 filename 4-digit-code
goto :eof)
if not defined code goto :eof

for /f "tokens=1-5 delims=/: " %%a in ("%~t1") do set dt=%%c%%a%%b%%d%%e
echo ren %1 %code%%dt%.%~n1


Report •

Related Solutions

#4
January 18, 2016 at 18:06:56
i am sorry nbrane. its not works

Report •


Ask Question