how can I remove the exit of this batch but avoid it to loop

February 29, 2012 at 08:55:47
Specs: Windows 7

Hello,

Ivo as help me to build this batch, now my problem is that I need to run this batch inside another batch, and what happens is that when it runs this part it runs properly, but then exit and it does not run the rest of the batch file, I think it is because of the "exit" at the end, but if I remove the exit it will loop and it will never end, is there a way to not stop running it?

thank you


@echo off & setlocal EnableDelayedExpansion > "File.new"
for /F "delims=" %%j in ('type "File.txt"') do call :CLEAN %%j
exit

:CLEAN
set line=%*
set cnt=0
for /L %%k in (17 1 34) do if "!line:~%%k,1!"=="0" (set /A cnt+=1) else (goto :DONE)
:DONE
set /A pos= 17 + %cnt%
set /A lgt= 18 - %cnt%

if %cnt% gtr 0 (
set filler=
for /L %%k in (1 1 %cnt%) do (set filler=!filler! )
set line=%line:~0,17%!line:~%pos%,%lgt%!!filler!%line:~35%
)
echo.%line%>> "File.new"
exit /B


See More: how can I remove the exit of this batch but avoid it to loop

Report •


#1
February 29, 2012 at 09:14:33

Report •

#2
February 29, 2012 at 09:19:13
Hi,

yes, I did try to use 2 batchs, on the main batch I had insert

call batch2.bat

it does run the first part of the batch, it call the second batch but them it does not resume the batch1, you know why?


Report •

#3
February 29, 2012 at 11:26:20
Replace the first "exit" with "goto :EOF"

How To Ask Questions The Smart Way


Report •

Related Solutions


Ask Question