Controlling NT services

A small convenience feature, to start/stop NT services.

<!-- Restart W3SVC -->
<service serviceName="w3svc" command='isInstalled' outTo='installed' />
<print>Service is ${=$installed?'installed':'not installed'}</print>
<if isTrue='${installed}'>
        <service serviceName="w3svc" command='stop' />
        <service serviceName="w3svc" command='waitForStopped' />
        <service serviceName="w3svc" command='start' />
        <service serviceName="w3svc" command='waitForRunning' />

Delaying and timing script execution

<!-- Wait for 5 seconds, then for 3 more seconds, then print the elapsed time (should be around 8 seconds if my math is right) -->
<timer format="elapsed" outTo="tm">
        <print newline='false'>Waiting for 5 seconds...   </print>
        <sleep timeout='00:00:05' />
        <print newline='false'>Almost ...</print>
        <sleep timeout='3000' />
<print>Elapsed: ${tm}</print>