Moving file when file date is the same as system date

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
vipin_jha123
Posts: 3
Joined: 24 Sep 2013 23:50

Moving file when file date is the same as system date

#1 Post by vipin_jha123 » 25 Sep 2013 00:08

Im trying to have my batch script to copy a .log file from one folder and copy it to another folder only if the *.log file date modified is the same as the system date...can any one help me ?

Thanks & regards,
Vipin jha

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Batch file query

#2 Post by foxidrive » 25 Sep 2013 00:50

What does this show with your log file name?


Code: Select all

@echo off
for %%a in ("file.log") echo "%%~ta"
pause

vipin_jha123
Posts: 3
Joined: 24 Sep 2013 23:50

Re: Moving file when file date is the same as system date

#3 Post by vipin_jha123 » 25 Sep 2013 01:17

Hi ,

I am having tousand of log file in C:\IISLOGS Folder.
there are 1 file for 1 day, I want to move current date file from C:\IISLOGS TO D:\IISLOGS Folder.

My file format is like "ex130922.log"
Please sugest me script of doing the same.

thanks and regards,
Vipin jha

vipin_jha123
Posts: 3
Joined: 24 Sep 2013 23:50

Re: Moving file when file date is the same as system date

#4 Post by vipin_jha123 » 25 Sep 2013 01:22

I am having Windows server 2000

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Moving file when file date is the same as system date

#5 Post by foxidrive » 25 Sep 2013 01:53

vipin_jha123 wrote:Hi ,

I am having tousand of log file in C:\IISLOGS Folder.
there are 1 file for 1 day, I want to move current date file from C:\IISLOGS TO D:\IISLOGS Folder.

My file format is like "ex130922.log"


I am having Windows server 2000


If you have Win 2000 then I need to know what this echos to the console:

Code: Select all

echo "%date%"

Post Reply