PC Review


Reply
Thread Tools Rate Thread

CMD window properties

 
 
John Martin
Guest
Posts: n/a
 
      3rd Aug 2004
I'm looking for a way to change the CMD window properties of the screen
buffer size height and width via a script (and save properties for future
windows with the same title).

thanx,
john


 
Reply With Quote
 
 
 
 
Dave Patrick
Guest
Posts: n/a
 
      3rd Aug 2004
Your script needs to set the values in this key;
HKEY_CURRENT_USER\Console

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"John Martin" wrote:
| I'm looking for a way to change the CMD window properties of the screen
| buffer size height and width via a script (and save properties for future
| windows with the same title).
|
| thanx,
| john
|
|


 
Reply With Quote
 
Clay Calvert
Guest
Posts: n/a
 
      4th Aug 2004
On Tue, 3 Aug 2004 12:50:20 -0600, "Dave Patrick"
<(E-Mail Removed)> wrote:

>Your script needs to set the values in this key;
>HKEY_CURRENT_USER\Console


Maybe I'm missing something, but I didn't understand how the Hex
values worked for ScreenBufferSize and WindowSize.

Sure, we could set what we wanted in one prompt then query, and record
the value for future scripts, but how does one calculate the values to
put in those registry settings?

Clay Calvert
(E-Mail Removed)
Replace "W" with "L"
 
Reply With Quote
 
David Candy
Guest
Posts: n/a
 
      4th Aug 2004
Divide it into two 16 bit numbers. One is height and one is width. Use Calc to converrt.
EG
012c0050

is
012c x 0050 hex
300 x 80 decimal

--
----------------------------------------------------------
'Not happy John! Defending our democracy',
http://www.smh.com.au/articles/2004/...392635123.html

"Clay Calvert" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> On Tue, 3 Aug 2004 12:50:20 -0600, "Dave Patrick"
> <(E-Mail Removed)> wrote:
>
> >Your script needs to set the values in this key;
> >HKEY_CURRENT_USER\Console

>
> Maybe I'm missing something, but I didn't understand how the Hex
> values worked for ScreenBufferSize and WindowSize.
>
> Sure, we could set what we wanted in one prompt then query, and record
> the value for future scripts, but how does one calculate the values to
> put in those registry settings?
>
> Clay Calvert
> (E-Mail Removed)
> Replace "W" with "L"

 
Reply With Quote
 
David Candy
Guest
Posts: n/a
 
      4th Aug 2004
This is a standard MS trick, two 16 bit numbers as one 32 bit.

--
----------------------------------------------------------
'Not happy John! Defending our democracy',
http://www.smh.com.au/articles/2004/...392635123.html

"David Candy" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
Divide it into two 16 bit numbers. One is height and one is width. Use Calc to converrt.
EG
012c0050

is
012c x 0050 hex
300 x 80 decimal

--
----------------------------------------------------------
'Not happy John! Defending our democracy',
http://www.smh.com.au/articles/2004/...392635123.html

"Clay Calvert" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> On Tue, 3 Aug 2004 12:50:20 -0600, "Dave Patrick"
> <(E-Mail Removed)> wrote:
>
> >Your script needs to set the values in this key;
> >HKEY_CURRENT_USER\Console

>
> Maybe I'm missing something, but I didn't understand how the Hex
> values worked for ScreenBufferSize and WindowSize.
>
> Sure, we could set what we wanted in one prompt then query, and record
> the value for future scripts, but how does one calculate the values to
> put in those registry settings?
>
> Clay Calvert
> (E-Mail Removed)
> Replace "W" with "L"

 
Reply With Quote
 
Dave Patrick
Guest
Posts: n/a
 
      4th Aug 2004
I didn't know that. Thanks Dave.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"David Candy" wrote:
Divide it into two 16 bit numbers. One is height and one is width. Use Calc
to converrt.
EG
012c0050

is
012c x 0050 hex
300 x 80 decimal

--
----------------------------------------------------------
'Not happy John! Defending our democracy',
http://www.smh.com.au/articles/2004/...392635123.html


 
Reply With Quote
 
Matthias Tacke
Guest
Posts: n/a
 
      4th Aug 2004
Clay Calvert wrote:

>On Tue, 3 Aug 2004 12:50:20 -0600, "Dave Patrick"
><(E-Mail Removed)> wrote:
>
>>Your script needs to set the values in this key;
>>HKEY_CURRENT_USER\Console

>
>Maybe I'm missing something, but I didn't understand how the Hex
>values worked for ScreenBufferSize and WindowSize.
>
>Sure, we could set what we wanted in one prompt then query, and record
>the value for future scripts, but how does one calculate the values to
>put in those registry settings?
>


Hello Clay and John,
you might find the following batch useful, returning this on my w2k:
==screen=copy==========================================================
C:\test>ConsoleSizes.cmd
Window_X*Y_|_Buffer_X*Y_|_App-key_____________________________
80*25 | 80*300 | HKCU\console
80*50 | 0*0 | HKCU\console\%SystemRoot%_system32_cmd.exe
120*60 | 120*60 | HKCU\console\cmd.exe
80*25 | 80*300 | HKCU\console\Far.exe
80*25 | 80*300 | HKCU\console\Settime from Mars
==screen=copy==========================================================

Where the last entry is the name of a shortcut on my desktop, so these
values are stored in sub keys of HKCU\Console (may be in parallel to the
..lnk file)

::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
--
Greetings
Matthias________________________________________
For help on nt commands enter in a cmd window:
W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm
 
Reply With Quote
 
Clay Calvert
Guest
Posts: n/a
 
      5th Aug 2004
On Wed, 4 Aug 2004 15:13:48 +0200, "Matthias Tacke"
<(E-Mail Removed)> wrote:

Thank you very much.

>::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::::::::::::::::::::::::::::::::::::::::::::::::::::


Clay Calvert
(E-Mail Removed)
Replace "W" with "L"
 
Reply With Quote
 
John Martin
Guest
Posts: n/a
 
      5th Aug 2004
thanks, for all the great info!

-john

"Dave Patrick" <(E-Mail Removed)> wrote in message
news:uR$(E-Mail Removed)...
> I didn't know that. Thanks Dave.
>
> --
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "David Candy" wrote:
> Divide it into two 16 bit numbers. One is height and one is width. Use

Calc
> to converrt.
> EG
> 012c0050
>
> is
> 012c x 0050 hex
> 300 x 80 decimal
>
> --
> ----------------------------------------------------------
> 'Not happy John! Defending our democracy',
> http://www.smh.com.au/articles/2004/...392635123.html
>
>



 
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
Advanced Document Properties to Standard Properties Window? TychaBrahe Microsoft Word Document Management 1 3rd Apr 2008 12:25 AM
Designer Support: How to have user control's properties appear in IDE's properties window? Max2006 Microsoft ASP .NET 2 13th Jul 2007 02:45 PM
Docking Project Explorer, Properties window and Code window in VBE jayray Microsoft Excel Setup 2 27th Mar 2007 04:42 PM
Visual Inheritance: Can I add custom properties to properties window? Maxwell2006 Microsoft Dot NET Framework Forms 2 18th Oct 2006 08:38 PM
setting properties via properties window during runtime Herfried K. Wagner [MVP] Microsoft VB .NET 2 1st Jun 2005 05:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:47 PM.