You can use cmdow (http://www.commandline.co
Main Topics
Browse All TopicsI'm pulling my hair out over this one.
CMD's properties show: Screen Buffer: w=80, h=300
Window Size: w=80, h=25
This is similar in appearance to a COMMAND window except it has a scrollable text background and therefore has a right-hand scrollbar.
In a batch file, MODE CON LINES=25 will set CMD's number of lines to 25 therefore, creating a 'scrolless' window and thus hiding the scrollbar.
CMD's properties now show: Screen Buffer: w=80, h=25
Window Size: w=80, h=25
Before exiting the batch file, MODE CON LINES=300 sets CMD's window's lines back to 300 thereby restoring it's scrollbar however, the Winow Size changes too.
CMD's properties show: Screen Buffer: w=80, h=300
Window Size: w=80, h=40
1) Is there an explanation why this happens?
2) Can CMD's lines be restored to 300 without effecting it's Window_Size.Height setting?
3) Is there a registry-setting, or INI file-type solution?
Basically, I want to be able change CMD to a scrolless 25-lined window at the start of the batch file, and then restore it back to a scrollable 300-line window before exiting the batch file - BUT, without effecting the actual phyiscal size of the window itself (and certainly without effecting the Window_Size.Height setting). Can this be done?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You can use cmdow (http://www.commandline.co
Hiya guys.... First of all, thank you for your participation. Let me answer your question (Bill and Qlemo)...
I'm writing a series of batch files with embedded assembler routines (I know.... batch files.... embedded assembler. I've heard all the jokes). The embedded routines just means the user does not have to rely on external third-party commands. These batch files will run in a COMMAND box as well as a CMD box under XP. To ensure the display is consistent, I want to set CMD's window to the same size as COMMAND's window during execution then reset it to how the user had it prior to running the batch file (out of courtesy of course). I acknowledge some people will might run these batch file in a COMMAND box while others might run them in a CMD box. Basically, it's just a case of maintaining consistency.
That's why I don't want CMD's Window_Size to default to 40 lines when reseting CMD's Screen_Buffer.Height.
So my proposal would work. You know yourself how to read out the windows settings of the cmd box out of registry, I assume, and you can then reset the windows size to those values with cmdow.
Further I suppose you won't use
start /w command ASMprg.com > c:\output.txt
type c:\output.txt
to have the command window separated.
Gentlemen
None of the comments are particularly helpful. I am however, exploring whether this behaviour is due to writing 16-bit code / 32-bit code instead of Win32 code.
abqBill
>> "are these assembler programs MS-DOS programs? If so, this is likely why the screen is resizing"
FINDSTR.EXE is a DOS program but that doesn't effect the appearance of a DOS window
>> "be aware that such scripts will fail on 64-bit Windows"
Good advice.
>> "I recommend finding Win32 versions"
Still exploring whether Win32 code is the answer to this problem
Much Googling has not helped either. I have also bought no less than 6 (used) books on assembler - again, nothing mentioned there.
There are two issues here:
1) Why does only certain code (or COM and EXE programs) effect a DOS window
2) When the DOS window's LINES= setting is restored, why does it effect the size of the window
Strange, I'm about to pose this (2nd) question to MS and see if there is a work-around
Actually, that's an interesting comment because, the two settings which you would think effect the window's appearance are:
ScreenBufferSize.Height
WindowSize.Height
and you would think using MODE CON LINES=300 would only affect the ScreenBufferSize.Height.
Let's face it, there's no way in a billion years XP is going to expand the window size to 300 lines so why expand it at all.
I requested a ScreenBufferSize.Heught of 300 bu XP epands the DOS winfow to 40,It doesn't make sense.
Furthermore, there's a separate setting for WindowsSize.Height - so setting the buffersize should not strictly affect the WindowSize.
It just doesn't make sense.
Please do not reply to this as there is no need to...unless you can add something not already mentioned.
Okay, I accept 16-bit DOS applications running on a 32-bit machine is going to run under 'emulation' but this does not explain why the ODS box does not return to it's original physical size afterwards.
Nevertheless, we're almost there.
Hi t0t0, this is a side-effect of the MS-DOS emulation. There is no way, that I know about, to change this behavior, and AFAIK, Microsoft will not be addressing further DOS emulation problems (seeing as the DOS emulation no longer exists in 64-bit Windows). I would abandon the DOS program approach and use native Windows console utilities instead. Bill.
Business Accounts
Answer for Membership
by: deroodePosted on 2009-06-10 at 04:07:21ID: 24589912
There doesn't seem to be a nice way to do this, there is however a kludgy way:
In your batch file:
mode con: lines=25
pause
start cmd.exe
exit
Effectively, this first sets the screen to 25 lines, then after the pause it opens a new cmd screen and shuts down the old. The disadvantage is that the new cmd box appears at a different place, and command history is lost.