?
Solved

XP - MORE and DOSKEY defaults

Posted on 2003-03-25
7
Medium Priority
?
671 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:billious
  • 3
  • 3
7 Comments
 
LVL 30

Expert Comment

by:SteveGTR
ID: 8204850
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
0
 
LVL 2

Accepted Solution

by:
bryancw earned 200 total points
ID: 8207927
Most of shell commands have been extended in NT based OS's.  Create a dword registry key as follows to turn off command extensions.  

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions

A value of 0 will disable the extensions.

Be aware that this has an effect on pretty much every shell command.  I believe that this setting can also be applied globally if you create the same key under HKEY_LOCAL_MACHINE.

For overstrike, open a shell prompt (cmd.exe) and invoke properties (right click on the banner and choose properties from context menu).  On the options tab, clear the check next to "Insert Mode" and hit OK.  Make sure to select "Save properties for future windows" to make the setting persist.




0
 
LVL 7

Author Comment

by:billious
ID: 8208096
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
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 30

Expert Comment

by:SteveGTR
ID: 8210980
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 :)
0
 
LVL 7

Author Comment

by:billious
ID: 8211972
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
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 8212144
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
0
 
LVL 7

Author Comment

by:billious
ID: 8274753
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
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question