Simpler solution:
Write a script that does the whole thing once and then schedule it with the Task Scheudler to run every 60 seconds or 5 minutes or whatecer interval. The impact on the server should be less.
_________________________
There are two types of vessels, submarines and targets.