Solved

Script or batch to copy XML on loop

Posted on 2014-11-24
2
385 Views
Last Modified: 2014-11-24
I need to monitor a particular XML file on a Windows machine and copy it to a location every 10 seconds.  Right now, I use xcopy on a scheduled tasks, but that can only run once a minute.  I really need to copy the file every 10 seconds.  So I need a script or batch to copy the file, pause 10 secs, then run again, in a loop, unless there is another option.
0
Comment
Question by:murryc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 40462457
Just use a batch that runs in an endless loop and waits 10 seconds between copies; you can use a scheduled task to run it at system startup, or start it once manually:
@echo off
setlocal
:Loop
echo [%Date%][%Time%]Copying ...
xcopy.exe ...
ping.exe -n 11 localhost >NUL
goto Loop

Open in new window

0
 

Author Comment

by:murryc
ID: 40462495
Perfect!
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question