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