@echo off
setlocal
:start
for /f %%G in ('time /T') do if %%G gtr 22:29 goto exit
set found=0
for /f "skip=3 tokens=2" %%G in ('tasklist /fi "ImageName eq DTSRemotingServer.exe"') do set found=1
if %found%==0 start D:\DTSRemotingServer\DTSRemotingServer.exe
ping -n 5 localhost > nul
goto start
:exit
setlocal
:start
for /f %%G in ('time /T') do if %%G gtr 22:29 goto exit
set found=0
for /f "skip=3 tokens=2" %%G in ('tasklist /fi "ImageName eq DTSRemotingServer.exe"') do set found=1
if %found%==0 start D:\DTSRemotingServer\DTSRemotingServer.exe
ping -n 5 localhost > nul
goto start
:exit
echo Check time over, exit
taskkill /f /im "DTSSSClientWSV.exe"