The script you found seems valid to me, if you start new lines at the correct position.
You can add an echo statement before the if statement to see if cdate and mdate have a correct value.
And check if myprogram.bat exist in the directory.
Here is a modified version which shows this. Can you try this, and post the output if it does not work?
@echo off
for %%F in (C:\TEST\myfile.avi) do (for /F %%D in ("%%~tF") do (set mdate=%%D))
for /F "tokens=2" %%D in ('date/t') do set cdate=%%D
echo cdate="%cdate%" mdate="%mdate%" current dir=%cd%
if "%cdate%"=="%mdate%" going to start myprogram.bat
if "%cdate%"=="%mdate%" start myprogram.bat
pause
edit
Here is a version which works independent of the regional settings. It is based on this solution.
@echo off
reg copy "HKCU\Control Panel\International" "HKCU\Control Panel\International-Temp" /f > NUL
reg add "HKCU\Control Panel\International" /v sShortDate /d "yyMMdd" /f > NUL
for %%F in (C:\TEST\myfile.avi) do (for /F %%D in ("%%~tF") do (set mdate=%%D))
for /F "tokens=1" %%D in ("%date%") do set cdate=%%D
echo cdate="%cdate%" mdate="%mdate%" current dir=%cd% date="%date%"
reg copy "HKCU\Control Panel\International-Temp" "HKCU\Control Panel\International" /f > NUL
if "%cdate%"=="%mdate%" start myprogram.bat
It first makes a backup of the shortdate format in the registry. Then it replaces it with yyMMdd. Now it looks for the modification date of the file and the current date. before comparing the dates, it restores the shortdate format.