Windows 10: Previous commands left in title-bar of command-prompt under Windows 10

Discus and support Previous commands left in title-bar of command-prompt under Windows 10 in Windows 10 Customization to solve the problem; (Note: the "Windows topics" selection of "Windows settings" doesn't really fit, but seemed a less-bad fit than any of the others). Within a... Discussion in 'Windows 10 Customization' started by TripeHound, Oct 3, 2019.

  1. Previous commands left in title-bar of command-prompt under Windows 10


    (Note: the "Windows topics" selection of "Windows settings" doesn't really fit, but seemed a less-bad fit than any of the others).


    Within a command-prompt window, when you run a command, the title-bar of the window is altered to show the command being executed. For instance, if the title was MyCMD and you run DIR /S then, for the duration, the title becomes MyCMD - DIR /S. When the command finishes, the original title is restored.


    Under Windows 10, under some circumstances, this restoration does not happen: the command is left in the title, even after it has finished. Running the command again adds a second copy and so on. The simplest reproduction of this is with the following two batch-files:


    batch1.bat

    (batch2.bat)

    echo Should not be reached


    batch2.bat

    dir


    If you run batch1, the title will change from MyCMD to MyCMD - batch1 but does not revert to the original when it returns to the command-prompt. If you run it a second time, the title becomes MyCMD - batch1 - batch1 and so on, as the following shows:


    Previous commands left in title-bar of command-prompt under Windows 10 ca0062fc-86fb-491a-a798-b9953418c718?upload=true.png


    Some exploration shows that this only seems to happen when (a) the second batch-file is invoked without using CALL (i.e., so that control will not return to the original batch-file), and (b) the invocation is within parentheses (while their use in the above example is slightly artificial, the original example where I spotted this used an IF statement... something like IF condition ( batch2 ) ELSE ( ... ). Changing the first line of batch1 to either (call batch2) or batch2 will prevent the corruption of the title-bar (although the first means that control returns to batch1, which is not what was wanted).


    Under Windows 7, the above works as expected (the original title is restored). Specific versions tested: Windows 10 version 10.0.17763.615 and Windows 7 version 6.1.7601.

    (This can be worked-around by, for instance, changing the first line of batch1 to (call batch2 & goto :eof), but is there a "cleaner" way, or is this a "bug" in the Windows 10 command-prompt?

    :)
     
    TripeHound, Oct 3, 2019
    #1
  2. cwtech Win User

    command prompt will not open in safe mode with command prompt

    Would I just follow the same steps within safe mode after hooking up to the other system?
     
    cwtech, Oct 3, 2019
    #2
  3. cwtech Win User
    command prompt will not open in safe mode with command prompt

    I am repairing a laptop for a friend and I need to access windows in safe mode and the owner has forgotten the password to the main user. I tried logging on with the administrator profile in safe mode but it is not showing up so I was going to use command prompt in safe mode with command prompt but command prompt will not open when I boot that option. Does anyone have any hints for me to figure this out?
     
    cwtech, Oct 3, 2019
    #3
  4. Naki Win User

    Previous commands left in title-bar of command-prompt under Windows 10

    GPU-Z what command line parameter ?

    Suggestion: /? (-?) and /help (-help) command-line arguments to show a list of all possible arguments in a small window. *Smile Previous commands left in title-bar of command-prompt under Windows 10 :)
     
    Naki, Oct 3, 2019
    #4
Thema:

Previous commands left in title-bar of command-prompt under Windows 10

Loading...
  1. Previous commands left in title-bar of command-prompt under Windows 10 - Similar Threads - Previous commands left

  2. commands for command prompt not working

    in Windows 10 Gaming
    commands for command prompt not working: im trying to reset my laptop and everytime it says there was a problem resetting your pc so i looked up a youtube vid on how to fix this and came across the command "dism /online /cleanup-image /restorehealth" when i press enter however NOTHING happens, i let it sit for a...
  3. commands for command prompt not working

    in Windows 10 Software and Apps
    commands for command prompt not working: im trying to reset my laptop and everytime it says there was a problem resetting your pc so i looked up a youtube vid on how to fix this and came across the command "dism /online /cleanup-image /restorehealth" when i press enter however NOTHING happens, i let it sit for a...
  4. commands for command prompt not working

    in Windows 10 BSOD Crashes and Debugging
    commands for command prompt not working: im trying to reset my laptop and everytime it says there was a problem resetting your pc so i looked up a youtube vid on how to fix this and came across the command "dism /online /cleanup-image /restorehealth" when i press enter however NOTHING happens, i let it sit for a...
  5. Command prompt

    in Windows 10 Customization
    Command prompt: It seems that I have to renew my command prompt almost monthly by use of the "bootsect /nt60 sys" command. Why is this happening ? https://answers.microsoft.com/en-us/windows/forum/all/command-prompt/6ca7646e-66a4-45cf-ab84-781950936dee
  6. "rename" command in Command Prompt

    in Windows 10 Network and Sharing
    "rename" command in Command Prompt: Never thought I'd have another DOS question, but ... never say never, I guess. So I have a folder with sub-folders named with the dates of all the weekdays in April, in the format 2019-04-xx_. I want to change the names to May, i.e. replace "04" with "05". I opened a...
  7. Command Prompt

    in Windows 10 BSOD Crashes and Debugging
    Command Prompt: On my PC cmd not working properly https://answers.microsoft.com/en-us/windows/forum/all/command-prompt/1997eabc-1c65-4dd5-a223-03a83f66ccf6
  8. command prompt

    in Windows 10 Customization
    command prompt: hi, Is the 64 bit operating system, alright to run on the 32 bit administrator command prompt? https://answers.microsoft.com/en-us/windows/forum/all/command-prompt/0202ade4-c9cf-4456-80b3-5ee9a53dd104
  9. command prompt commands

    in Windows 10 Installation and Upgrade
    command prompt commands: Can anybody just tell me what the command prompt for starting up in safe mode with networking is, if there is one? https://answers.microsoft.com/en-us/windows/forum/windows_10-update/command-prompt-commands/7b058934-65f0-40dc-8982-936764895a61
  10. commands in command prompt

    in Windows 10 Support
    commands in command prompt: is there a full list of DOS style Commands buried somewhere in win10 i try CHKDSK and get nowhere with the command unless I'm typing it wrong. but there are a few otthers i would be interested in as well. 54240