|Thanks a lot its workings, But still I have one more issue, i have function PCCONN in Cognos application ,|
That Command should be execute first and then the remaining logic should run
But once that Function execution is done, bat file is get finish without executing the remaining code below it.
Is there any function i can give like -f after PCCON command so that it will execute the remaing code too after this command.
REM --------- Step 1: Use pcconnect to Redirect the datasource ---------
cd C:\Program Files\cognos\c83\webapps\utilities\PCConn
pcconn -f C:\Cognos_Data\Batch_Files\DynamicPackaging\RedirectDS.txt > "C:\Cognos_Data\Logs\DynamicPackaging_PCConn.log"
type nul> tempsearch.txt
::// WORD TO SEARCH FOR.
find /i "UNIX" < "C:\Cognos_Data\Logs\DynamicPackaging_PCConn.log" >> tempsearch.txt
::// CHECK IF WORD APPEARS 5+ TIMES.
for /f %%A in (tempsearch.txt) do (
set /a counter +=1
if %counter% GEQ 5 goto :GREATER_OR_EQUAL
echo PCCON success >>"C:\Cognos_Data\Batch_Files\Cubemonitoring\Test.txt"
echo PCCON Failure >> "C:\Cognos_Data\Batch_Files\Cubemonitoring\Test.txt"