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.
Stop a batch file
Name: js Date: September 21, 2000 at 11:37:25 Pacific
Comment:
How do you stop a batch file while it is executing?
Name: DoOMsdAY Date: September 21, 2000 at 12:12:05 Pacific
Reply:
Depends on the situation. If the batch is calling another program, it will exit once that program does (and once the batch file reaches the last line of execution.) If you need to stop it for some reason, put a label at the very bottom of the file and jump to it. An example:
@echo off
:loop if exist c:\file.txt goto end goto loop
:end
The above will loop until the file 'c:\file.txt' is created. This is essentially useless in a single-process OS, but it's an example so it passes my inspection.
0
Response Number 2
Name: Laurence Date: September 21, 2000 at 12:55:12 Pacific
Reply:
Doomsday is absolutely right - it depends. Give more details.
Well, here's one method, anyway.
TYPE nul>%temp%.\batexit.bat %temp%.\batexit.bat
0
Response Number 3
Name: DUH ! Date: September 21, 2000 at 15:18:58 Pacific
Reply:
C'mon guys. Your answers are a bit too complicated for an answer to a simple question. How about using CONTROL+C.
Summary: hi: I want to write a batch file so that the following info is put into a text file: user name computer name log in date as each new user logs onto my network, the above info is put into the text file...