1

I wanted to clear the history of typed command lines,

So I called DOSKEY /REINSTALL as explicitly told in the help, but then, my command prompt closed !

Isn't this the right way to clear the history of typed command lines ?

  • It may have closed like that because it needed to run as administrator (and so did not run). Open cmd.exe with Run as Administrator and see how it runs this way. See the answer in this thread on clearing the history (look down to the second answer) superuser.com/questions/1185761/… – John Feb 14 at 20:01
  • Alright, thank you. – Aybe Feb 15 at 22:27
  • Was my comment an answer for you? – John Feb 15 at 22:39
  • Yes, it helped me out, thank you. – Aybe 2 days ago
1


I suggest visiting this post .: Multi-line menu with options selection via DOSKEY

...doskey handle two buffers, the buffer of the doskey macros, and the buffer of the commands history. Apparently doskey /reinstall not works, it reset any buffer. Also /history show anything even when you see commands with F7...


Just try using:

%__APPDIR__%doskey.exe /listsize=0 && %__APPDIR__%doskey.exe /listsize=50 

This will reset your doskey history

%__APPDIR__%doskey.exe /listsize=0
%__APPDIR__%doskey.exe /listsize=50

rem ::  or...
%__APPDIR__%doskey.exe /listsize=0 && %__APPDIR__%doskey.exe /listsize=50

For additional, about your prompt closed !...

Verify if there is some bat/cmd with same name: DOSKEY.cmd DOSKEY.bat

%__APPDIR__%where.exe /r \ doskey.*
  • Use the full path/name to %__APPDIR__%DOSKEY.exe instead only DOSKEY /REINSTALL
doskey.exe /reinstall
%__APPDIR__%doskey.exe /listsize=0 && %__APPDIR__%doskey.exe /listsize=50

Obs.: Try running doskey.exe (with the full path), from one of the command line outputs below, it may be the doskey.exe file in c:\windows\system32 maybe corrupted...

%__APPDIR__%where.exe /r \ doskey.*

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.