This pauses the screen and waits for a keypress before it closes the command prompt screen. This is because you put the command at the end of your script. Step 8: Your batch script would now close all the programs specified in it.Īlso, you will be able to see which all programs got closed on the Command Prompt screen. You will now get the following Rename confirmation window. Step 6: Once you have entered the name, click somewhere else on the screen. Whatever name you give, make sure you give the extension of the file as bat after the. Step 5: You can give any name to your file, we have named it as Close Multiple Programs. Step 4: Now get back to Desktop, click on the file and press the F2 key to rename the file. Taskkill /F /IM wps.exe /T > you are all done, do not forget to hit the keys CTRL + S together to save the file. Taskkill /F /IM CalculatorApp.exe /T > nul Otherwise, the CMD screen would close in a flash.Īn example script, where we are closing the programs Notepad, Calculator and WPS office, using our batch script, is shown below.
For example, if a program couldn’t be closed, then you will be able to see the reason why it couldn’t be closed, on the CMD screen. Each line would correspond to a single application or program.įinally, at the end write This is for you to see the results of your command executions. Nul – To suppress the errors and messages. T – To terminate all the children of the process. If you don’t know the Image Name of the process that you want to kill, please refer to Section 3: How to Find the Image Name of the Process / Application to be Closed. IM is followed by the process’s Image Name. F – To forcefully terminate the running process. Taskkill – To kill the process or the application. The command parameters are explained below: You can refer to Section 3: How to Find the Image Name of the Process / Application to be Closed, if you don’t know the Image Name of the process that you want to kill. Please note that you have to replace with the Image Name of the application that you want to close. Step 3: As next, in the text document, copy and paste the following command. Step 2: Now double click on the text document that you just created, to open it. Once at the Desktop, right click on empty space, click on New and then click on text Document. Step 1: Go to the Desktop instantly by pressing the WIN + D keys together. Section 1: How to Create and Execute the Batch Script to Close Multiple Programs at Once Section 3: How to Find the Image Name of the Process / Application to be Closed.Section 2: How to Add More Programs to the Existing Batch Script.Section 1: How to Create and Execute the Batch Script to Close Multiple Programs at Once.