Command to prevent the command prompt closing by itself after executing the previous command in a windows batch file The below line will prevent the command prompt closing by itself after executing the previous command. cmd /k Share this:TwitterFacebookLike this:Like Loading...