Abort Windows Batch Script
Question by Guest | 2016-11-06 at 16:57
Is there any possibility to quit, cancel or abort a Windows Batch Script (.BAT) out of itself? I have some conditions in my script after which I want to discontinue the further script processing in some cases.
Can someone help me? Is there any command for that?
Related Topics
Windows Batch Script: Computer Shutdown
Tutorial | 2 Comments
Put Windows via Script into Hibernation or Sleep Mode
Tutorial | 0 Comments
jQuery: Submit complete form and receive content with Ajax
Tutorial | 0 Comments
Continue calling Batch Script after EXIT
Question | 1 Answer
jQuery: Send HTML5 Canvas to Server via Ajax
Tutorial | 0 Comments
Lazarus: Detect Operating System (Compiler Switch)
Tutorial | 0 Comments
Abort Batch Script if File does not exist
Question | 1 Answer
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
The command you are searching for is EXIT. Just write EXIT into your batch script and the script will be canceled at this point.
A condition can look like that, for example:
Here the script is discontinued in case that the file "file.txt" is not existing.
If you should have started your batch script out of another batch file, and if you only want to abort the current script and not the calling script, this question should be interesting for you.
2016-11-07 at 14:44