Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to Abort a Command Execution in Command Prompt?

  • Last Updated : 17 Sep, 2021

Command Prompt is an interpreter which helps us to execute various commands and functions. These commands may include diskpart, install, cls, etc. Using Command Prompt, we can perform a variety of functions, eg, formatting any drive/Pendrive or compiling any file, or getting IP address using ip-config.

But, what happens if any command stops executing?

What to do if the command prompt gets stuck? How to get out of it? Do we need to close the prompt or we can just abort that particular command and continue from the same place where we left?

We will find these answers in this article;

Suppose we are executing a command the below command:

 npm install bootstrap

Now we can use the below keys to terminate the command execution:



Ctrl+ Pause/break

After you press the button a message will appear whether you want to terminate this job or not as shown below:

Now Type ‘Y’ and hit “Enter” to terminate the process.

What if say type “N”?

The Command will continue to execute if we type “N” when prompted. Take a look at the below image where we run the below command:

npm start

Then we hit Ctrl+C to terminate the execution. When prompted for confirmation, we type in “N” as shown below:

In this example, after typing “N” , the command continued its execution and completed it.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!