Ich bräuchte mal eure Hilfe...
Ich muss ein Batch-Programm (WIN) schreiben, welches mir alle Dateien liefert, welche letzten Monat erstellt
wurden... Kann mir da jemand helfen??
::--------getDiffInMinutes.bat
@echo off & setlocal
set "quellpfad=e:\"
Pushd %quellpfad%
REM Datetime-Delimiter sind Punkt, Doppelpunkt, SPACE bei einem Datum "16.12.2005 18:53"
set "dtdelims=.: "
for /f %%i in ('dir /b /A-d *.*') do (
Set "Filename=%%~fi"
for /f "tokens=1-5 delims=%dtdelims%" %%a in ("%%~ti") do (
If [%%a.%%b.%%c]==[%date%] call :compareMinutes %%d %%e
)
)
Popd
goto :eof
~~~~~~~~~
:compareMinutes
for /f "tokens=1-2 delims=:" %%i in ("%time%") do set /a "nowMinutes=(%%i*60)+%%j"
Echo %time:~0,5% ------ entspricht %nowMinutes% Minuten.
REM Heute sind um 18:50h 18*60+50Minuten vergangen...
set /a "FileMinutes=(%1*60) + %2"
Set /a "DiffMinutes=%nowMinutes%-%FileMinutes%"
IF %DiffMinutes% GEQ 5 echo verschiebe Datei %Filename% nach x:\yz...
goto :eof
::--------snapp getDiffInMinutes.bat