(view source code of modified.cmd as plain text)
@ECHO OFF
REM * MODIFIED.CMD
REM * Check if specified file was created or modified today
REM * OS/2 version
REM * Written by Rob van der Woude
REM * Needs write access to current directory; or add fully qualified
REM * path to files CURRENT.CMD and its language dependent versions,
REM * and make sure its path is specified in the PATH variable.
REM * File name should be specified
IF "%1"=="" GOTO Syntax
IF NOT EXIST %1 GOTO Syntax
REM * Send DIR output for specified file to primary temporary
REM * batch file to get the file's creation or modification date
DIR %1 | FIND /I "%1" > %TEMP%.\~ISMODIF.TMP
ECHO.>> %TEMP%.\~ISMODIF.TMP
TYPE %TEMP%.\~ISMODIF.TMP | TIME | FIND /I "%1" > %TEMP%.\~ISMODIF.CMD
REM * Create secondary temporary batch files to be called by primary
ECHO SET CHKDATE=%%4>ENTER.CMD
REM * For Dutch DOS versions
ECHO SET CHKDATE=%%5>VOER.CMD
ECHO SET CHKDATE=%%6>TYP.CMD
CALL %TEMP%.\~ISMODIF.CMD
REM * Send DIR output for temporary batch file to itself to get today's date
DIR %TEMP%.\~ISMODIF.CMD | FIND /I "~ISMODIF.CMD" > %TEMP%.\~ISMODIF.TMP
ECHO.>> %TEMP%.\~ISMODIF.TMP
TYPE %TEMP%.\~ISMODIF.TMP | TIME | FIND /I "~ISMODIF.CMD" > %TEMP%.\~ISMODIF.CMD
REM * Create secondary temporary batch files to be called by primary
ECHO SET NOWDATE=%%4>ENTER.CMD
REM * For Dutch DOS versions
ECHO SET NOWDATE=%%5>VOER.CMD
ECHO SET NOWDATE=%%6>TYP.CMD
CALL %TEMP%.\~ISMODIF.CMD
REM * Compare dates and display result
IF "%NOWDATE%"=="%CHKDATE%" ECHO %1 was created or modified today (%NOWDATE%)
REM * Clean up the mess
DEL %TEMP%.\~ISMODIF.CMD
DEL %TEMP%.\~ISMODIF.TMP
DEL ENTER.CMD
DEL VOER.CMD
DEL TYP.CMD
SET CHKDATE=
SET NOWDATE=
GOTO End
:Syntax
ECHO MODIFIED.CMD
ECHO Check if specified file was created or modified today
ECHO OS/2 version
ECHO Written by Rob van der Woude
ECHO.
ECHO.
ECHO Usage: %0 filename
:End
page last modified: 2024-04-16; loaded in 0.0067 seconds