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
Solved

Script or batch to copy XML on loop

Posted on 2014-11-24
2
379 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

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…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to dynamically set the form action using jQuery.

840 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