Computing.Net > Forums > Disk Operating System > Stop a batch file

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

Reply to Message Icon

Name: js
Date: September 21, 2000 at 11:37:25 Pacific
Comment:

How do you stop a batch file while it is executing?



Sponsored Link
Ads by Google

Response Number 1
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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Stop a batch file

Pause a batch file for 10 sec' www.computing.net/answers/dos/pause-a-batch-file-for-10-sec/8249.html

User log in date from a batch file www.computing.net/answers/dos/user-log-in-date-from-a-batch-file/7783.html

Can you execute a batch file for a web page www.computing.net/answers/dos/can-you-execute-a-batch-file-for-a-web-page-/5382.html