- On a new system new users inherit settings from
Default/Default User
- Console settings are stored in the registry in
HKCU\Console
and subkeys
- PowerShell console settings deviating from the standard are stored in
subkeys:
HKEY_CURRENT_USER\console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe
HKEY_CURRENT_USER\console\%SystemRoot%_SysWOW64_WindowsPowerShell_v1.0_powershell.exe
Aside from this, any shortcut file to PowerShell can store these settings also.
To view current settings run in a Cmd window:
reg query hkcu\console
In PowerShell run:
gci hkcu:Console|where Name -like '*powershell*'|ft -auto
ScreenBufferSize and WindowSize are 32 bit values (REG_DWORD
) composed of 16bit height + 16bit width values.
I wrote this batch to decode the sizes:
:: 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%
Shortened sample output:
Window_X*Y_|_Buffer_X*Y_|_App-key_____________________________
80*25 | 0*0 | HKCU\console
132*60 | 132*3000 | HKCU\console\%SystemRoot%_System32_cmd.exe
120*50 | 120*3000 | HKCU\console\%SystemRoot%_system32_diskpart.exe
120*50 | 120*300 | HKCU\console\%SystemRoot%_system32_help.exe
120*50 | 120*3000 | HKCU\console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe
120*50 | 120*3000 | HKCU\console\%SystemRoot%_SysWOW64_WindowsPowerShell_v1.0_powershell.exe
120*50 | 120*3050 | HKCU\console\Bitvise ansi terminal
132*50 | 132*350 | HKCU\console\Bitvise bvterm terminal
120*50 | 120*3050 | HKCU\console\Bitvise xterm terminal
132*50 | 132*50 | HKCU\console\C:_Program Files (x86)_Far_Far.exe
120*50 | 120*50 | HKCU\console\C:_Program Files (x86)_Kinesics_Text_Editor_x64_k.exe
252*98 | 252*98 | HKCU\console\C:_Program Files_Far_Far.exe
So the short answer is: edit console in default users registry hive.
Additionally, shortcut files that target PowerShell store their own ScreenBufferSize/WindowSize values.