| 1. |
Solve : Keep CMD Window Open After BAT Runs? |
|
Answer» Basic question, I know - but I can never get CH's "Search" to find if things have been answered before... When you execute cmd.exe that is a normal console window.A "normal" console window is some sort of c:\ prompt.... Yes? Quote from: BC_Programmer on March 09, 2018, 09:19:19 PM cmd /k works for me at the end of a test batch file. After the batch file completes I get a standard command prompt:When I run your file, I get a c:\ prompt. Hm. Will start from scratch tomorrow and re-report.... #HeadscratcherQuote from: BC_Programmer on March 09, 2018, 09:19:19 PM cmd /k works for me at the end of a test batch file. After the batch file completes I get a standard command prompt:You can see the window title change when you respond to the Pause command and the batch exits. Quote from: rjbinney on March 09, 2018, 11:13:48 PM A "normal" console window is some sort of c:\ prompt.... Yes?Isn't that what you are asking for? I can use BC's script above, with cmd /k at the end, and after I press a key (because of the Pause command) I see the command prompt and can enter a command e.g. Dir, echo %date%, whatever. I can also make a version of that script, but with cmd /k omitted from the end, and call it from the prompt, like this cmd /k batchfile.bat and the same thing happens. This also causes a return of the prompt if the script has an Exit command at the end. Rjbinney, are you starting your "simple .BAT file" by double clicking it in WINDOWS EXPLORER, or by typing its name at the command prompt? |
|