When running scripts, etc. using the Windows console terminal window, you often want to change it's appearance. To change the size of the window, we can use a command such as:
mode con: cols=160 lines=60
However, changing the font that is used, especially if running WinPE, is a lot more tricky, especially as we cannot reboot after changing the registry.
Whilst looking for a solution, I found the handy SetConsole utility.
Usually, terminal and lucida fonts are always available (and also consolas in some later Windows OS's).
The primary things SetConsole.exe can do are:
mode con: cols=160 lines=60
However, changing the font that is used, especially if running WinPE, is a lot more tricky, especially as we cannot reboot after changing the registry.
Whilst looking for a solution, I found the handy SetConsole utility.
Usually, terminal and lucida fonts are always available (and also consolas in some later Windows OS's).
The primary things SetConsole.exe can do are:
- Change the font type and size (doesn't work for XP apparently)
- Enlarge the window without making it too large
- Placement of the window on the desktop, including moving to another display in a multi-display system
- Set buffer sizes
- Enable Quick Edit mode
- Minimise the console, bring it to foreground (or even hide it completely)
SetConsole works under WinPE. There are 32-bit and 64-bit versions, so you need to run the correct one. It also can also retrieve some useful information like /title for current and original console title, or use /status for all the console information including a list of supported fonts, window size, position, number of monitors, etc.
e.g.
setconsole max-10 tr = set console to maximum size minus 10 lines and 10 characters wide, and at top-right position on screen.
setconsole max-10 tr = set console to maximum size minus 10 lines and 10 characters wide, and at top-right position on screen.
Together with the standard Windows color command, we now have much better control over a terminal window!
We can even completely hide the console (useful for Rubber Ducky covert scripts?).
We can even completely hide the console (useful for Rubber Ducky covert scripts?).
No comments:
Post a Comment