Page 1 of 1

Clear typeahead buffer in DOS

Posted: 26 Mar 2012 09:10
by miskox
Hi all,

I was wondering if this is possible to achieve in DOS.

ZX Spectrum code:

Code: Select all

10 IF INKEY$ <>"" THEN GO TO 10 
20 IF INKEY$ ="" THEN GO TO 20


OpenVMS DCL code:

Code: Select all

$ set term/notypeahead


I was doing some repeating tasks. After a specific tasks completed I used a

set/p to wait for ENTER key to be pressed because I had to do something else and the process *must* wait.

So, I accidently pressed the ENTER key twice.

I would like to avoid this. Is there a way to clear a typeahead buffer? So that the key presses are not remembered? If I press the ENTER key twice (or 3+ times) it will not remember this.

Thanks,
Saso

Re: Clear typeahead buffer in DOS

Posted: 26 Mar 2012 09:14
by abc0502
why don't you make the order to continue is a another key like "a, b, .." and enter key to it will confirm the order
i think it will be easier :)

You can make it '+Enter key

Re: Clear typeahead buffer in DOS

Posted: 26 Mar 2012 10:50
by tonysathre
This may be what you're looking for:

doskey /keysize:1

Tony

Re: Clear typeahead buffer in DOS

Posted: 26 Mar 2012 17:02
by foxidrive
miskox wrote:I was doing some repeating tasks. After a specific tasks completed I used a

set/p to wait for ENTER key to be pressed because I had to do something else and the process *must* wait.



Use this to start your process with the wait option.

start "" /w "c:\folder\precess.exe"