Commandline history randomness :-(

  • Thread starter Thread starter R.Wieser
  • Start date Start date
R

R.Wieser

Hello All,

I've got a problem with XP's command-prompts (cmd.exe) commandline-history
behaviour:

Quite often when I press the "up" arrow (to go back to the previously typed
commandline, or, on a next key press, to the one above it) I find myself ...
somewhere in that list, but definitily *not* at the bottom of it.

This is disconcerting, as it can land me on a command which nullifies all
the work I've previously done on a file (by *again* copying an origional
file to my working-folder, thereby erasing the work I just did on the copy).

My question therefore is: can I tell the commandline-history to *allways* go
to the bottom of its history-list (and not display any form of a to me
counter-productive 'intelligence') ?

If that is not possible, how do I disable that commandline-history (without
blocking other programs to take its place -- Can't seem to get an old
version (W98se) of DosKey.com running ...).

Regards,
Rudy Wieser
 
Hello All,

I've got a problem with XP's command-prompts (cmd.exe)
commandline-history behaviour:

Quite often when I press the "up" arrow (to go back to the
previously typed commandline, or, on a next key press, to the one
above it) I find myself ... somewhere in that list, but definitily
*not* at the bottom of it.

This is disconcerting, as it can land me on a command which
nullifies all the work I've previously done on a file (by *again*
copying an origional file to my working-folder, thereby erasing
the work I just did on the copy).

The up-arrow will take you to the last command that you executed. If
the last command that you executed was generated by hitting the up-
arrow to go to a previous command and then you modify that command,
then the last command executed would be the last command in the
history list. OTOH, if you go to a command in history with the up-
arrow and execute it unaltered, then the last command you executed
was that line in history and subsequent up-down arrows will be
relative to that point.

My question therefore is: can I tell the commandline-history to
*allways* go to the bottom of its history-list (and not display
any form of a to me counter-productive 'intelligence') ?

Sure, just press Page-Down before pressing the up-arrow.
If that is not possible, how do I disable that commandline-history
(without blocking other programs to take its place -- Can't seem
to get an old version (W98se) of DosKey.com running ...).

You can change the length of the history buffer to "1".
For example:

C:\>doskey /reinstall /listsize=1

Keep in mind that after Windows 98 & ME, the command line window is
not really a DOS window but a program emulating it.

Some good reading that you might be interested in:

"The Windows NT Command Shell"
< http://technet.microsoft.com/en-us/library/cc723564.aspx >

HTH,
John
 
R.Wieser said:
snip
Can't seem to get an old
version (W98se) of DosKey.com running ...

Windows XP does not use Doskey.com from Win98, it uses Doskey.exe, in
the system32 folder.

You should not need to use Doskey, since the behavior you want is built
into the command prompt in XP.
 
Hello Glee,
You should not need to use Doskey, since the behavior you
want is built into the command prompt in XP.

My apologies if I was not clear, but the reason I posted is that that
program does *NOT* exhibit the behaviour I expect from it.

As it does not I would like either to know of a way to make it behave
consistently, or to be able to replace it. If its really a part of the
cmd.exe either of the above might be difficult to do.

Regards,
Rudy Wieser

-- Origional message:
 
Hello John,
OTOH, if you go to a command in history with the up-
arrow and execute it unaltered, then the last command you executed
was that line in history and subsequent up-down arrows will be
relative to that point.

I just tested that (yeah, really want to get to the bottom of this :-) ) and
looking at the F7 "last commands" list it looks you're right. In it the
repeated comand is highlighted.

Funny though: its also displayed at the bottom as the last executed command.

But that does not take away the problem I have with it (its seeming
randomness) to have the selection-point to *allways* start at the bottom, no
exception. Any idea how ?
Sure, just press Page-Down before pressing the up-arrow.

And no, that is not my idea of a/the solution, sorry.
You can change the length of the history buffer to "1".
For example:

C:\>doskey /reinstall /listsize=1

That cure would be worse than the disease I'm afraid, I'm really using that
command-history. Any chance that it allows itself to be un-installed (or
simply not installed/started in the first place) ?

And thanks for the clarification.

Regards,
Rudy Wieser


-- Origional message:
 
R.Wieser said:
Hello Glee,


My apologies if I was not clear, but the reason I posted is that that
program does *NOT* exhibit the behaviour I expect from it.

As it does not I would like either to know of a way to make it behave
consistently, or to be able to replace it. If its really a part of
the
cmd.exe either of the above might be difficult to do.

Have you tried running Doskey.exe (not Doskey.com) to see if it has the
behavior you want, or if it gives you the same problem as cmd.exe?
 
Hello Glee,
Have you tried running Doskey.exe (not Doskey.com) to see if it
has the behavior you want, or if it gives you the same problem as
cmd.exe?

I've even tried to remove that DosKey.exe program (from the system32 as well
as the dllcache folders and rebooting afterwards), but to no avail. The
DosKey.exe program itself knows a /reinstall switch, but no /uninstall (or
equivalent) one. And it looks like that before I can get rid of that one I
can't even start to test others.

By the way: Looking at the commands that it uses (like
SetConsoleCommandHistoryMode) and googeling them does not really turn up
anything usable either. Bummer.

Oh yeah: The first thing I tried (before posting here) was to google "DosKey
xp". Not much there either ...

Regards,
Rudy Wieser


-- Origional message:
 
Hey people,

Looking at the kind & type of replies I got it looks like I asked my
question in the wrong newsgroup.

Does anyone know where I should ask my question instead ?

Regards,
Rudy Wieser


-- Origional message:
 
Back
Top