doskey /history doesn't work properly after doskey reinstall

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
siberia-man
Posts: 126
Joined: 26 Dec 2013 09:28
Contact:

doskey /history doesn't work properly after doskey reinstall

#1 Post by siberia-man » 16 Oct 2014 13:15

I am not sure if this is specific for my computer. Can some one test it and confirm?

The test is very simple.

1. open command prompt
2. execute few commands
3. check the command history by the command doskey /history
4. clear the history list doskey /reinstall
5. repeat the item 2 (arbitrary commands)
6. check the history doskey /history

On the step 6 the list seems empty. However the previous commands from the step 5 are available by navigation keystrokes and visible by pressing F7.

npocmaka_
Posts: 481
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

Re: doskey /history doesn't work properly after doskey reins

#2 Post by npocmaka_ » 16 Oct 2014 16:11

Can confirm the behavior:

Code: Select all

>echo a
a

>echo b
b

>echo c
c

>doskey /history
cls
echo a
echo b
echo c
doskey /history

>doskey /reinstall

>echo a1
a1

>echo b1
b1

>echo c1
c1

>doskey /history

>


echo a1,b1,c1 are visible with up arrow.

Aacini
Expert
Posts: 1618
Joined: 06 Dec 2011 22:15
Location: México City, México

Re: doskey /history doesn't work properly after doskey reins

#3 Post by Aacini » 16 Oct 2014 20:12

I previously reported this problem at this topic, where I used the DOSKEY history to achieve a multi-line menu. Accordingly to my tests, doskey /reinstall works the first time only when it is followed by a F7 key, doskey /listsize=# does not works, nor Alt-F7 (to delete the history).

Antonio

siberia-man
Posts: 126
Joined: 26 Dec 2013 09:28
Contact:

Re: doskey /history doesn't work properly after doskey reins

#4 Post by siberia-man » 17 Oct 2014 00:29

Aacini, thank you. Probably this is the most robust solution to clear history and keep the functionality:

Code: Select all

doskey /listsize=0
doskey /listsize=50

where the default value 50 can be replaced by another value as requested.

Post Reply