For this, type the following code in your Notepad and save the file with the. You can prevent Command Prompt window from closing after running commands through adding a Registry Key in the Windows Registry. You can easily see each command which had run on the result of bat file in CMD as long as you do not press any key. This will keep the Command Prompt window open until you do not press any key.
Now add “PAUSE” word at the end of your bat file. The second way I am going to show you is also a simple method.Įdit your bat file by right clicking on it and select “Edit” from the list. This is the very easy and handy way to prevent the Command Prompt window from closing after running commands.