Dear experts,
How do I create a dos batch file to copy only todays(current date) files from the directory.
Dear experts,
How do I create a dos batch file to copy only todays(current date) files from the directory.
You would need to batch files.
First one:
Second one (this is where I start getting confused):Code:@echo off
set /p destination="Destination: "
for /f %%a in ('dir') do call copyFile.bat %%a %%~ta %destination%
From what I can tell, that should work, but it doesn't quite work right. Think you can get it from there?Code:@echo off
set today=%date:~5,15%
if %today% == %2 copy %1 %3
Here is a script. (I am assuming that when you say today's files, you mean files modified today.) It starts in directory "dir1". It copies files to "dir2" .Quote:
How do I create a dos batch file to copy only todays(current date) files from the directory.
Script is in biterscripting ( http://www.biterscripting.com ) .Code:var str today ; set today=gettime()
cd "dir1"
var str list ; lf -n "*" ( ($fmtime >= $today) AND ($fmtime <= $today) AND ($ftype=="f") ) > $list
while ($list <> "")
do
var str file ; lex "1" $list > $file
system copy $file "dir2"
done
Patrick
How do I create a dos batch file to copy files into current date folder
All times are GMT -7. The time now is 05:20 PM. |