Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Script or batch to copy XML on loop

Posted on 2014-11-24
2
Medium Priority
?
393 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 85

Accepted Solution

by:
oBdA earned 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
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 and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

730 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