In order for these values to have an effect,
cmd.exe
must not be started via the
Start menu: this will use the values that are stored in an
.lnk
file. Start
cmd.exe
(or PowerShell) using
Win+R
however will use the values stored in the registry.
Set window and buffer size
Set the size of the window and buffer
set-strictMode -version latest
# $regKey = 'HKCU:\Console\%SystemRoot%_system32_cmd.exe'
$regKey = 'HKCU:\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe'
if (! (test-path $regKey) ) {
$null = new-item $regKey
}
$width = 180
$windowHeight = 75
$bufferHeight = 9999
$screenBufferSize = 0x10000 * $bufferHeight + $width
$windowSize = 0x10000 * $windowHeight + $width
$null = new-itemProperty -path $regKey -name ScreenBufferSize -value $screenBufferSize -force
$null = new-itemProperty -path $regKey -name WindowSize -value $windowSize -force
Allow copying
If
QuickEdit is enabled, a portion of the screen can be selected with the mouse and copied into the
clipboard by pressing the enter key.
TODO: Is this possible in
Windows 10 with a common
control-c
?
$eatOutput = new-itemProperty -path "HKCU:\Console\%SystemRoot%_system32_cmd.exe" -name QuickEdit -value 1 -force