propnsa.blogg.se

How to resize a program window to default
How to resize a program window to default






Subkeys, such as %SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe, contain overrides for specific executables / window titles. Key HKEY_CURRENT_USER\Console ( HKCU:\Console) contains the overall defaults. Open the new window's system menu, select Properties and configure the window size as desired.įuture windows launched the same way will have the same size.Ĭonsole window properties are stored in the registry at HKEY_CURRENT_USER\Console, with the REG_DWORD value WindowSize containing the window size, and ScreenBufferSize containing the buffer size: As papo points out, you can also preset the window size for PowerShell instances you invoke via the Start Menu, via the Win-X shortcut menu, or via File Explorer's File > Open Windows Powershell command that way, by modifying the preexisting underlying shortcut file: "$env:AppData\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk"Ĭhange the default window size to your liking, but note that this then applies to all PowerShell sessions started with just the executable name (or path):.The commands above run after the new window has been created with the default size, which can be visually disruptive.Ĭreate a shortcut file that targets powershell.exe, configure its properties to set the desired size, then run the shortcut file ( *.lnk) to open the window. If you don't want to resize the window after it has opened with the default size: If you run the above command from an existing Command Prompt or PowerShell console, the new PowerShell session starts in the current window, and therefore resizes the current window.įrom a Command Prompt ( cmd.exe): use start: start powershell -noexit -command "::windowwidth=100 ::windowheight=50 ::bufferwidth=::windowwidth"įrom a PowerShell console window: use Start-Process (note the single quotes around the argument list): start-process powershell '-noexit -command "::windowwidth=100 ::windowheight=50 ::bufferwidth=::windowwidth"'

how to resize a program window to default

NET type to set the window width and height, and additionally sets the buffer width to the same value as the window width, so as to ensure that no horizontal scroll bar appears. Note: powershell -noexit -command "mode con cols=100 lines=50" works in principle, but has the unfortunate side effect that you lose any scroll-back buffer (the buffer height is set to the window height). The following command starts PowerShell in a console window with the default size and then resizes the window to 100 columns x 50 rows: powershell -noexit -command "::WindowWidth=100 ::WindowHeight=50 ::BufferWidth=::WindowWidth"








How to resize a program window to default