Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Batch file calls second, goto :EOF ends both?
Name: techphets Date: August 25, 2009 at 05:51:34 Pacific OS: Windows XP Subcategory: Batch
Comment:
I have one batch file calling a second. In the second file there is a FOR loop. I exit the FOR loop with a goto :EOF command but this seems to end both batch files. How can I end only the second batch file (the one with the for loop in it)?
Name: Piet Date: August 25, 2009 at 07:55:08 Pacific
Reply:
How do you call your second batch file ?
if you just use: b.bat it will go wrong you should use: call b.bat
Hopes this helps
0
Response Number 2
Name: klint Date: August 25, 2009 at 07:55:14 Pacific
Reply:
Could it be that you forgot to use the CALL command in the first batch file? If you just "run" the second batch file from the first, you transfer control to the second batch file (like a goto) rather than calling it.
0
Response Number 3
Name: klint Date: August 25, 2009 at 07:57:07 Pacific
Reply:
Piet got there first with the same advice... just beat me by 6 seconds!
0
Response Number 4
Name: Piet Date: August 25, 2009 at 08:01:06 Pacific
Summary: Here is my batch file: CALL :FINDPROC ) GOTO :EOF :FINDPROC FOR /F "TOKENS=9 DELIMS=," %%F IN ('TYPE %INFILE%^') DO ( SET /A LASTHOUR1 = %%F GOTO :EOF ) My %INFILE% reads: 19:00:03,03/25/2004,8.81...
Summary: I know this is already solved but I would like to point out that the method you used in your post almost worked. Instead of inputting the whole text file into each line, input the whole text file into...
Summary: I recently found this forum and have found it extremely helpful. However, in looking at several postes relating to nested FOR loops, I have not been able to locate info to assist me with my latest pro...