batch: file modified in 5 minutes?

January 31, 2010 at 20:52:12
Specs: Windows 2000
I am a newbie to programming batch dos. Can someone help me in writing a script that determines if a file has been modified within 5 minutes using dos?
If the file has been modified, then move the file to archive.

See More: batch: file modified in 5 minutes?

Report •

#1
January 31, 2010 at 22:16:10
I think you will find that this is too complex for a batch script and that you should be looking at VB script. Not only the time must be interrogated, the date must also be considered.

You should probably post in the Programming forum.

Good luck.


Report •

#2
February 1, 2010 at 06:44:36
@echo off & setLocal EnableDELAYedeXpansion

if not exist old copy myfile old > nul
:loop
fc myfile old > nul
if errorlevel 1 echo do the archive
copy myfile old > nul
ping -n 1 -w 300000 1.1.1.1 > nul
goto :loop


=====================================
Helping others achieve escape felicity

M2


Report •

#3
February 1, 2010 at 17:55:44
What does this command do?

"if not exist old copy myfile old > nul"


Report •

Related Solutions

#4
February 1, 2010 at 22:59:36
It makes a copy of myfile called old.

You can replace MYFILE with the name of the file you want to check for changes.

Replace every instance; not just one.


=====================================
Helping others achieve escape felicity

M2


Report •

Ask Question