In windows command prompt, say we are running a command (batch file)


but we typo as


Then when we press F8 next time at 'run',it will still pop with 'runtet'.

Is there any way to remove this incorrect command from auto completion list without restarting the cmd prompt? Or a better way to achieve this?

Without restarting because, there are other commands which are relevant for auto completion and also the environment (though it can be set by batch file).


Certainly is.

Try pressing up-arrow rather than F8 to return to previous lines. You can then use left/right-arrow to position the cursor. By default, any characters you type will be inserted at the cursor (you can change this); pressing INSert toggles between insert and overtype mode.

I'll let you guess what Del Home and down-arrow do...

Pressing enter will execute the reformed line and replace the history-list pointer to the last command entered (ie. the reformed line)

  • Why is Home special here? I mean, it works on the command line similar to how it would work in a text editor, and so if you've mentioned Home, why not mention End as well? Or did you, perhaps, mean a different button (with a different function)? – Andriy M Jun 26 '13 at 12:02
  • 1
    It does edit the current command but doesn't modify/remove it from history. The incorrect (typo) still remains in history, if we press F8 >1 the incorrect one shows up. Thanks for your suggestion though. – dushyantp Jun 26 '13 at 12:02

Just press F8 multiple times till you reach the correct command, or press F7 to select the command easily.

You can completely clear command history using Alt+F7, but cannot selectively delete a single command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.