@ECHO OFF :: Check Windows version IF NOT "%OS%"=="Windows_NT" GOTO Syntax VER | FIND.EXE /I "Windows NT" >NUL && GOTO Syntax :: Check if two valid files are specified IF NOT EXIST "%~2" GOTO Syntax IF NOT EXIST "%~1" GOTO Syntax :: Check if REGINA.EXE and FILEDATE.REX are available IF NOT EXIST "%~dp0FileDate.rex" GOTO Syntax REGINA.EXE -? >NUL 2>&1 || GOTO Syntax :: Apply the source file's timestamp to the target file FOR /F "tokens=1,2" %%A IN ('ECHO.%~t1') DO REGINA.EXE "%~dp0FileDate.rex" "%2" /D%%A /T%%B :: Done GOTO:EOF :Syntax ECHO. ECHO CloneDate.bat, Version 1.11 for Windows 2000 and later ECHO Apply the first file's timestamp to the second file specified ECHO. ECHO Usage: CLONEDATE sourcefile targetfile ECHO. ECHO Where: sourcefile is the file whose timestamp is read ECHO targetfile is the file the retrieved timestamp is applied to ECHO. ECHO Note: This batch file uses Regina Rexx and my FILEDATE.REX script to change ECHO the target file's timestamp. FILEDATE.REX must be in the same directory ECHO where this batch file is located, and REGINA.EXE should be in the PATH. ECHO. ECHO Written by Rob van der Woude ECHO http://www.robvanderwoude.com