![]() The linked solution will let you decide if you want to skip the pauses if the batch file was run from a command prompt window. If you run the batch file from within a command prompt window, these pauses can be annoying. Using CHOICE, you can program the ability for the user to select a variety of actions to take, and using TIMEOUT can let the window close after a time delay (unattended). This way, if you click on a batch file or link (shortcut) from within Windows Explorer, you can have the batch file program pause before it exits so you can view the program output and any error messages. Rather than using PAUSE (I prefer CHOICE or TIMEOUT to using PAUSE when necessary), you can use the solution here: 886848/how-to-make-windows-batch-file-pause-when-double-clicked. So how does it work? Can you give me any ideas to solve this problem? It just changed the behaviour of the command line window when opening it explicitly (Start-Run-cmd.exe). I put cmd /d /k as a value of it to give it a try, but this didn't change the behaviour of the stuffs mentioned above at all. HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor\AutoRun ![]() I've read an article about changing default behavior of cmd.exe when opening it explicitly, with creating an AutoRun entry and manipulating its content in these locations: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\AutoRun Finds it a little bit uncomfortable to run cmd.exe all the time and doesn't have the time/opportunity to rewrite the code of these commands everywhere to put a pause after them or avoid exiting explicitly.when running a shortcut from Start menu (or from somewhere else), OR Runs the program the first time and doesn't know that the given program will run in Command Prompt (Windows Command Processor) e.g.Running these programs with cmd /k like this: cmd /k myprogram.batīut there are some other cases in which the user:.with net start xy or anything similar) within cmd.exe(Start - Run - cmd.exe) Running these batch files or other command line manipulating tools (even service starting, restarting, etc.Putting a pause line after batch programs to prompt the user to press a key before exiting.Normally, this behavior can be avoided with three methods that come to my mind: To solve this, I want the default behavior to be that the window is kept open. My problem is that in Windows, there are command line windows that close immediately after execution.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |