Fun with dirdate and touch
Instead of 'Fun with Dick and Jane' you can have a lot of fun playing with file and folder date-time stamps instead ;-P
For example:-
Wouldn't it be fun to release this file with an older date-time stamp, making it appear as though you are super-uber-l33t (!) ;P2009-09-21 12:45:00 PRE Collectorz.com.Movie.Collector.Pro.v6.4.1-TE
2 utilities are used 'touch' and 'dirdate'.
Touch.exe is a Microsoft Resource Kit utility for playing with date-time stamps only on files though. Folders it cannot do which sucks.
Dirdate.exe [Only registered and activated users can see links. ] is a great program by DataMystic company with tons of options for playing with date-time stamps, on files and folders.
Title showing downloaded folder date-time stamps
]
Title showing downloaded file date-time stamps
]
Process of dirdate and touch
]
Touching the container archive as well ;P
]
Container contents showing new date-times
]
Container showing new date-time ;P
]
[code]
:: ######## Get date-time for touch command; format is 'touch /d mm-dd-yy <filespec>' /t hh:mm:ss ########
date /t > %TEMP%\date.tim
time /t> %TEMP%\time.tim
:: ================ FOR LOOP ================
FOR /F "TOKENS=*" %%A IN (%TEMP%\date.tim) DO SET date=%%A
FOR /F "TOKENS=*" %%A IN (%TEMP%\time.tim) DO SET time_a=%%A
:: ## days. months, years ## Use set circumflex to get days. months, years
:: Note 0 prefix indicates Octal value in calc's !!
set date_day=%date:~0,2%
set date_mth=%date:~3,2%
set date_yer=%date:~8,2%
set time_a=%time_a::=-%
set date_match=no
:: Put day month values back by 1 over calendar year
:: ================ FOR LOOP ================
FOR /F "SKIP=3 DELIMS=: TOKENS=1,2,3,4" %%a IN (%SCRIPTLOC%\Support\months.txt) DO if "%date_day%" == "%%a" if "%date_mth%" == "%%b" set date_day=%%c& set date_mth=%%d& set date_match=yes
:: Check for 0 prefix in date_day - indicates octal number so screws up calc's !
echo %date_day% | FINDSTR /I /R /C:"0[1-9]" > nul
IF "%ERRORLEVEL%" == "0" set date_day=%date_day:~1,2%
:: Put day back by 1 in same month
if /i not "%date_match%" == "yes" if %date_day% neq 1 set /a date_day=date_day-1
...
...
:: ######### dirdate and touch ##########
:: Call random time setting sub-batch
IF /I "%DOTOUCH%" == "YES" CALL %SCRIPTLOC%\Batches\do-rtime.bat
:: run dirdate to change all folder-dates in DIR2?
IF /I "%DOTOUCH%" == "YES" ECHO ----- T o u c h i n g ----------------------------------------------- & ECHO dirdate touch folder : ... %DIR2% & start /MIN /W %DIRDATE% -ALL day=%date_day% month=%date_mth% hour=%time_hr% min=%time_min% sec=%time_sec% %DIR2%
IF /I "%DOTOUCH%" == "YES" ECHO with: ... date: %date_day%-%date_mth%-%date_yer% time: %time_hr%:%time_min%:%time_sec% & ECHO.
IF /I "%DOTOUCH%" == "YES" CALL %SCRIPTLOC%\Batches\do-rtime.bat
:: Do a touch on all files in DIR2
IF /I "%DOTOUCH%" == "YES" ECHO Touching all files in: ... %DIR2% & start /w %SCRIPTLOC%\Support\touch.exe /c /m /a /s /q /d %date_mth%-%date_day%-%date_yer% /t %time_hr%:%time_min%:%time_sec% %DIR2%\*.*
IF /I "%DOTOUCH%" == "YES" ECHO with: ... date: %date_day%-%date_mth%-%date_yer% time: %time_hr%:%time_min%:%time_sec% & ECHO.
...
[/code]
%SCRIPTLOC%\Support\months.txt
[code]
============================================
DAYS MONTHS -- day : month : day-1 : month-1
============================================
01:02:31:01
01:03:28:02
01:04:31:03
01:05:30:04
01:06:31:05
01:07:30:06
01:08:31:07
01:09:31:08
01:10:30:09
01:11:31:10
01:12:30:11
[/code]
%SCRIPTLOC%\Batches\do-rtime.bat
[code]
@echo off
BREAK ON
VERIFY ON
:: Called random time setting sub-batch
O_RANDOM_TIME
:: hr 0-23 min/sec 0-59 RANDOM - 32767/1400 = 23 32767/550 = 59
SET time_hr=%RANDOM%& SET /A time_hr=time_hr/1400
SET time_min=%RANDOM%& SET /A time_min=time_min/550
SET time_sec=%RANDOM%& SET /A time_sec=time_sec/550
IF %time_hr% gtr 23 GOTOO_RANDOM_TIME
IF %time_min% gtr 59 GOTOO_RANDOM_TIME
IF %time_sec% gtr 59 GOTOO_RANDOM_TIME
:: set time & pause
[/code]
have fun!