| 1. |
Solve : Batch for checking file? |
|
Answer» I need to check a log.txt file if it is changed, so if it is than must copy XL.txt file ... the same problem, but I found another solution without having to modify my batch script. The only thing that I missed out is at the 'Action' settings - "Start in (Optional)" option.For more info, search for: Windows task scheduler Hope that helps thanks, task scheduler is not a solution I need a batch. Perhaps you did not understand. Batch does not have an effective scheduler. Wasting time in batch is a bad idea. Instead you create a batch file that does what you want. It must be a cone time self-contained batch. No LOOPING. It runs once and stops. The n you make a task e to start that batch file every ten minutes. Make a batch file. Name it My_Job.bat and it must be a job that can be done in well under ten minutes. In an abstract way, it will do this: Start Task:: For every ten minutes Do My_Job.bat Next time frame End. No, you don't write that code, that is an abstract of what you tell the task schedule thing GADGET in Windows. It is not a batch command. Maybe a video will help https://www.youtube.com/watch?v=8tMzockuB2g Does that help? ... Yeah, the video has too much stuff. Here is a simple explanation Here is a simple explanation: Schedule a task in Windows 7 You have to give the name of a batch file with the full path. - Unless it is in the path. Quote from: GEEK-9pm on August 04, 2014, 11:16:02 AM Perhaps you did not understand. Batch does not have an effective scheduler. Wasting time in batch is a bad idea. Instead you create a batch file that does what you want. It must be a cone time self-contained batch. No looping. It runs once and stops. Batch can do that very efficiently, Geek. Code: [SELECT]:loop echo ... timeout /t 600 /nobreak goto :loop Quote from: foxidrive on August 04, 2014, 11:23:15 AM Batch can do that very efficiently, Geek. OK. That will work. That is easier that reading up on how to use the Scheduler. Ok that's sounds good. But how can I use that loop, because file is filling up differend time to get 1k and than to get 2k to get noticable for command FCI guess I would check the Archive Attribute. Every time a file changes the archive attribute should be turned on. Code: [Select]H:\>echo hello>mylog.txt H:\>attrib mylog.txt A H:\mylog.txt H:\>xcopy /m mylog.txt H:\test\ H:mylog.txt 1 File(s) copied H:\>attrib mylog.txt H:\mylog.txt H:\>echo hello again>>mylog.txt H:\>attrib mylog.txt A H:\mylog.txtok how can I check with this if file is changed last 5 minutes?bump |
|