
:max_bytes(150000):strip_icc()/004_how-to-access-advanced-startup-options-in-windows-10-or-8-2626229-5bd39b2846e0fb00260a0963.jpg)

Close the Registry Editor when you are done.

Double click on that value and change its Value data to cmd.exe /k "%1" %*. You will find a “ (Default)” value on the right side. HKEY_CLASSES_ROOT\cmdfile\shell\open\command Click Yes if you get a UAC prompt.Ģ] In the Registry Editor, navigate to the following paths: HKEY_CLASSES_ROOT\batfile\shell\open\command Before you proceed, we recommend you create a backup of Registry.ġ] Launch the Run command box. You can skip editing the batch files by modifying the Registry keys. If you already have many batch files, you have to edit all of them. But the only downside of these two methods is you have to use those commands in every batch file. The above two methods stop Command Prompt from closing immediately after processing the batch file. 3] Editing the Registry key to stop Command Prompt from closing Right-click on the batch file and type cmd /k at the end of the batch file. The cmd /k command lets you execute new commands after the processing of the batch file without closing the Command Prompt. 2] Prevent Command Prompt from closing by using the cmd /k command If you want the Command Prompt to remain open so that you can execute other commands on the same window, you have to use the next method. The Pause command will only let you see how the commands are executed. Instead, it will display a message “ Press any key to continue…” When you press any key, the Command Prompt will close. Now, when you open the batch file, the Command Prompt will not close automatically after processing the file.
