(view source code of clonedate.bat as plain text)
@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
page last modified: 2024-04-16; loaded in 0.0074 seconds