Link to home
Start Free TrialLog in
Avatar of billious
billious

asked on

XP - MORE and DOSKEY defaults

Why Microsoft seems to force default to modified behaviour of facilities is beyond me, but Uncle Bill seems to be richer than me, so it appears to be advantageous.

In my brand-new XP system, which I purchased because a program that worked on NT decided it wouldn't work on XP so I have to debug it, the command prompt appears to have a couple of interesting features.

1) It appears to load DOSKEY automatically (good idea) but with the default /INSERT (bad idea, since /OVERSTRIKE was the default in earlier versions). I can't find any mention in *.NT of invoking DOSKEY to modify! Naturally, the new revised HINDER system has no apparent information.

2) Similarly, some cretin has modified MORE to have some extended features that are, according to the documentation (more/?|more) DISABLED by default, and controlled by the envvar 'more'. Despite having no 'more' envvar set, I'm appear to have the extended features enabled (well, more specifically the RETURN key gets one more line, rather than NEXT PAGE as in earlier versions - I'm not interested in the other 'enhancements' since I use more than one version of DOS/WINDOWS)

No doubt there are a few more surprises yet to be encountered, but any way of restoring the behaviour that has been normal for over 20 years?

...Bill
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

For your first item I'd suggest setting up a batch file that sets up your specification. It might contain:

@echo off

doskey /OVERSTRIKE

Change your shortcuts on your desktop and in the program menus to do the following:

%SystemRoot%\SYSTEM32\CMD.EXE /x /k c:\yourdir\startup.bat

I include the /x switch for extensions.

As for the 2nd item, I could find anyway of reverting back to the previous version's behavior through a command line switch.

You could create a directory and get a copy of the old more.com as well as the following DLL's:

ulib.dll
ntdll.dll
kernel32.dll

You could create a macro to replace more and have it execute from this directory.

Good Luck,
Steve
ASKER CERTIFIED SOLUTION
Avatar of bryancw
bryancw

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of billious
billious

ASKER

bryancw, SteveGTR:

Certainly bryancw's 'insert mode' change cured the insert-during-doskey prob - and thanks for that.

"Save properties for future windows"?? Where's that?

As for the 'more' problem - I want to keep the NT enhanced-DOS features (like for /f... etc.) the only one I've found so far that I want to restore to the original is specifically the 'More' behaviour. That way, both my NT-based systems will behave in the same way.

According to the docco,

MORE [/E [/C] [/P] [/S] [/Tn] [+n]] < [drive:][path]filename
command-name | MORE [/E [/C] [/P] [/S] [/Tn] [+n]]
MORE /E [/C] [/P] [/S] [/Tn] [+n] [files]

    [drive:][path]filename  Specifies a file to display one
                            screen at a time.

    command-name            Specifies a command whose output
                            will be displayed.

    /E      Enable extended features
    /C      Clear screen before displaying page
    /P      Expand FormFeed characters
    /S      Squeeze multiple blank lines into a single line
    /Tn     Expand tabs to n spaces (default 8)

            Switches can be present in the MORE environment
            variable.

    +n      Start displaying the first file at line n

    files   List of files to be displayed. Files in the list
            are separated by blanks.

    If extended features are enabled, the following commands
    are accepted at the -- More -- prompt:

    P n     Display next n lines
    S n     Skip next n lines
    F       Display next file
    Q       Quit
    =       Show line number
    ?       Show help line
    <space> Display next page
    <ret>   Display next line


So, commandname|more with no envvar 'more' should give the ORIGINAL 'MORE' characteristic, <CR>=next-page.

It appears MORE is set to Enhanced-for-XP (different from NT &earlier MSDOS), but not only does the docco NOT say how envvar 'more' should be set, it only gives the 'turn on enhanced mode' setting, not the 'leave it as it always has been until Uncle Bill had a brainstorm over his morning orange juice and cornflakes' setting.

so - do you presume that the docco is wrong,and you should 'set more=e' to DISable the enhancements, or should MORE be set to -E, or /-E, /E, or what? It's easy enough to do in the environment settings - IF the documentation is available! (And philosophically, IMVHO should have been defaulted to...)

...Bill
Bill,

My understanding of the /E switch is that by using it it will enable the following features AT THE MORE PROMPT:

   P n     Display next n lines
   S n     Skip next n lines
   F       Display next file
   Q       Quit
   =       Show line number
   ?       Show help line
   <space> Display next page
   <ret>   Display next line

I don't believe you'd settle for a solution that required you to type "P25" after every page :)
SteveGTR:

The point is that MORE will prompt after each page, so the enhanced behaviour accepts <ret> as "next line" rather than the prior behaviour "next page."

The documentation clearly states that this is the behaviour IF
/E is specified (ie. type something|more/E)
OR if the envvar 'more' contains (I presume "/E")

The ACTUAL behaviour is that where there is no 'more' envvar, MORE still behaves as though one of the above conditions is true, thus 'type something|more' will cause the "ENHANCED" behaviour (<ret> -> next LINE) as though MORE had been specified with /E.

The documentation shows only how to turn the 'MORE' Enhanced behaviour ON, not OFF. I've just tried with a 'more' envvar of both /E and /-E. /E made no difference, and /-E gave an 'invalid parameter "/-E" error.

...Bill
Your point? You want to have MORE behave as before. Is this working for you? If not, then accept some suggestions and stop crying...

You know, if they broke the way MORE worked as you like it you could always write your own MORE utility.

Good Luck,
Steve
I'm trying to keep the machine set up straight-from-Redmond, with minimum customisation.

I'm afraid the MORE is a lost cause - Microsoft has failed to reply (their local office acknowledged that it wasn't my imagination, but was unwilling to DO anything about it) and it appears it has been broken in this way since 2K.

Disabling the extensions (cmd/y) stopped all the NT enhancements, all right (like FOR /F) EXCEPT the MORE functionality, which is stuck ON regardless. I'll admit to not having tried the registry-edit (for reasons above) but that's only supposed to "permanentise" the cmd/y switch, if I read cmd/? correctly.

...Bill