PC Review


Reply
Thread Tools Rate Thread

How to change _buffer_ size of console window (or can runas inherit console props)?

 
 
Alex Blekhman
Guest
Posts: n/a
 
      16th Mar 2005
Hello,

I'm regular to work with console window that is 100 cols x 40 lines.
Console buffer is taller: 100 x 300. So, I have vertical scroll bar on
console window. Now, when I run 'runas' command, then new console is
open with default size, i.e.: 80x25.

I can use 'mode con' command, but it influences only buffer size while
window size try to occupy as mach screen as possible.

Is there any possibility to set console window size and buffer size
separately? Alternatively, can I cause 'runas' command to propagate
current console settings to new process?

Thanks in advance
Alex


 
Reply With Quote
 
 
 
 
Matthias Tacke
Guest
Posts: n/a
 
      16th Mar 2005
Alex Blekhman wrote:
> Hello,
>
> I'm regular to work with console window that is 100 cols x 40 lines.
> Console buffer is taller: 100 x 300. So, I have vertical scroll bar on
> console window. Now, when I run 'runas' command, then new console is
> open with default size, i.e.: 80x25.
>
> I can use 'mode con' command, but it influences only buffer size while
> window size try to occupy as mach screen as possible.
>
> Is there any possibility to set console window size and buffer size
> separately? Alternatively, can I cause 'runas' command to propagate
> current console settings to new process?
>

Hallo Alex,
consetbuffer from Frank P.Westlake will do that.
Get it here: http://gearbox.maem.umr.edu/fwu/

----------------------------------------------------------------------
C:\>consetbuffer /?
Version 1.0, Copyright (C)2000, 2001 Frank P. Westlake
Sets the dimensions of the console buffer in columns and lines.

ConSetBuffer [/X|C|W=columns] [/Y|L|H=lines]

/X Specify the number of columns for the buffer width.
/C and /W are the same as /X.
/Y Specify the number of lines for the buffer height.
/L and /H are the same as /Y.

If either dimension is smaller than the applicable window dimension, the window
will be adjusted.

If neither argument is present, the current settings will be printed. The
dimensions will be taken from the standard error device (STDERR) so that the
correct values will be read when used with the FOR command. Nothing is written
to STDERR so to ensure that the correct values are obtained, do not redirect
STDERR. To save the dimensions in a batch program, use the following:

FOR /F "tokens=2,4 delims== " %%A in ('ConSetBuffer') Do (
Set Columns=%%A
Set Lines=%%B
)
----------------------------------------------------------------------

HTH

--
Gruesse Greetings Saludos Saluti Salutations
Matthias :-)
---------+---------+---------+---------+---------+---------+---------+
 
Reply With Quote
 
Alex Blekhman
Guest
Posts: n/a
 
      16th Mar 2005
Matthias Tacke wrote:
> Hallo Alex,
> consetbuffer from Frank P.Westlake will do that.
> Get it here: http://gearbox.maem.umr.edu/fwu/


Thanks!


 
Reply With Quote
 
David Wang [Msft]
Guest
Posts: n/a
 
      18th Mar 2005
It is actually just some registry key settings located at HKCU\Console. I
basically have a .REG file that sets up my cmd console window to exactly
what I want (window size, font, buffer size, color, quick edit, etc), and I
make sure to run that .REG file using all user accounts once. From now on,
all consoles opened by these users are exactly the same -- even when I use
RUNAS. And when I forget or run on a new system, I have the .REG file
shared on a public read UNC share so I am always one command away from
having my console settings.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Alex Blekhman" <tkfx^N05P4M^@yahoo.com> wrote in message
news:O%(E-Mail Removed)...
Matthias Tacke wrote:
> Hallo Alex,
> consetbuffer from Frank P.Westlake will do that.
> Get it here: http://gearbox.maem.umr.edu/fwu/


Thanks!



 
Reply With Quote
 
Matthias Tacke
Guest
Posts: n/a
 
      18th Mar 2005
David Wang [Msft] wrote:
> It is actually just some registry key settings located at HKCU\Console. I
> basically have a .REG file that sets up my cmd console window to exactly
> what I want (window size, font, buffer size, color, quick edit, etc), and I
> make sure to run that .REG file using all user accounts once. From now on,
> all consoles opened by these users are exactly the same -- even when I use
> RUNAS. And when I forget or run on a new system, I have the .REG file
> shared on a public read UNC share so I am always one command away from
> having my console settings.
>

I agree with that David.

There might be additional subkeys, this batch lists them with sizes.
(Requires reg.exe)

::ConsoleSizes.cmd::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
setlocal
echo Window_X*Y_^|_Buffer_X*Y_^|_App-key_____________________________
for /F "tokens=1-2,*" %%A in (
'reg query hkcu\console /s^|findstr "\ ScreenBufferS WindowS"') do (
if "%%B" NEQ "REG_DWORD" (set "HKCUCon=%%A %%B %%C"&set "SBS="&SET "WS=")
if "%%A" EQU "ScreenBufferSize" set "SBS=%%C"
if "%%A" EQU "WindowSize" set "WS=%%C" & call :display)
goto :eof
:display
set /A "WSW=WS&0xffff, WSH=WS>>16"
set "WSW= %WSW%"&set "WSH=%WSH% "
set /A "SBW=SBS&0xffff, SBH=SBS>>16"
set "SBW= %SBW%"&set "SBH=%SBH% "
set "HKCUCon=%HKCUCon:HKEY_CURRENT_USER=HKCU%"
echo/%WSW:~-5%*%WSH:~,5%^|%SBW:~-5%*%SBH:~,5% ^| %HKCUCon%
::ConsoleSizes.cmd::::::::::::::::::::::::::::::::::::::::::::::::::::

HTH

--
Gruesse Greetings Saludos Saluti Salutations
Matthias :-)
---------+---------+---------+---------+---------+---------+---------+
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Console Window Size JSheble Microsoft C# .NET 2 28th Jun 2005 01:22 AM
Console.Writeline hangs if user click into the console window Urs Eichmann Microsoft VB .NET 3 20th Jul 2004 06:48 AM
limiting the length of Console::Read(); or Console::Readline(); Vampier Microsoft VC .NET 0 12th Apr 2004 07:30 AM
How to set a fixed line in a console application liek UNIX console AA Microsoft C# .NET 1 6th Dec 2003 02:23 PM
How can i change a Console Size Gerald Maher Microsoft C# .NET 1 7th Nov 2003 05:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:35 PM.