Increasing text size in a batch file
Moderator: DosItHelp
-
- Posts: 19
- Joined: 20 Aug 2021 08:07
Increasing text size in a batch file
Hi I'm making a program in batch and I need the text to be bigger without altering anything at the properties menu.
It doesn't matter if it's an external command or pure batch, anything works.
Thanks
It doesn't matter if it's an external command or pure batch, anything works.
Thanks
Re: Increasing text size in a batch file
its been quite a while now since i had a similar problem. i found the following example code which dynaically modifies the registry. Maybe it helps
I opted to simply import a static registry file
regards, arjunae
Code: Select all
@echo off
setlocal enabledelayedexpansion enableextensions
set "cmd.con=HKCU\Console\%%SystemRoot%%_system32_cmd.exe /v"
Reg delete HKCU\Console\%%SystemRoot%%_system32_cmd.exe /f>nul
REM dont reentrant
if [%1]==[ok] goto:init
for %%a in (
"FaceName /t REG_SZ /d "Terminal" /f" "FontFamily /t REG_DWORD /d 48 /f" "FontSize /t REG_DWORD /d 1024294 /f" "FontWeight /t REG_DWORD /d 700 /f" "ScreenBufferSize /t REG_DWORD /d 13107280 /f" "CursorSize /t REG_DWORD /d 0 /f"
) do (
set "param=%%a" & set "param=!param:~1!" & set "param=%cmd.con% !param:~0,-1!" & Reg Add !param! >nul
)
echo %~0
pause
start /high cmd /q /k "%~0" ok
for %%a in (
"FaceName /f" "FontFamily /f" "FontSize /f" "FontWeight /f" "CursorSize /f"
) do (
set "param=%%a" & set "param=!param:~1!" & set "param=%cmd.con% !param:~0,-1!" & Reg Delete !param! >nul
)
:init
Code: Select all
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console\TinyTonCMD]
"FaceName"="Consolas"
"FontSize"=dword:000d0000
"ScreenColors"=dword:0000000a
"WindowAlpha"=dword:000000e7
"ColorTable00"=dword:00FFFFFF
"ColorTable10"=dword:0000c400
"ScreenBufferSize"=dword:07d0005f
"WindowSize"=dword:000e005f
"FullScreen"=dword:00000000
"HistoryNoDup"=dword:00000001
Code: Select all
reg import tinytonCMD.reg
start "TinyTonCmd"
-
- Posts: 19
- Joined: 20 Aug 2021 08:07
Re: Increasing text size in a batch file
thx ill try it
-
- Posts: 19
- Joined: 20 Aug 2021 08:07
Re: Increasing text size in a batch file
There is only one problem. How do I run code that I have already made with this preset?
for example, i tried to do
@echo off
reg import tinytonCMD.reg
cd Kernel
start "game.bat"
exit
That doesn't work for some reason, it will start the game without the preset in the registry file. It works fine with start "TinytonCMD".
In shorter terms, I'm trying to run premade code with this preset on. Is it possible?
for example, i tried to do
@echo off
reg import tinytonCMD.reg
cd Kernel
start "game.bat"
exit
That doesn't work for some reason, it will start the game without the preset in the registry file. It works fine with start "TinytonCMD".
In shorter terms, I'm trying to run premade code with this preset on. Is it possible?
Re: Increasing text size in a batch file
Edit As far as i know theres no dos api for directly applying changed registry Font settings.
tinyton is just a profile name for start to use for the interpreter. a static solution would be start "profile" cmd /c batch which is what i used but as atfon posting the link using escapes i will try that.
removed noisy code so its clear which option should be preferred.
tinyton is just a profile name for start to use for the interpreter. a static solution would be start "profile" cmd /c batch which is what i used but as atfon posting the link using escapes i will try that.
removed noisy code so its clear which option should be preferred.
Last edited by arjunae on 15 Dec 2022 14:17, edited 2 times in total.
Re: Increasing text size in a batch file
Once again, see this post for how to set the font size and name in the Console:
viewtopic.php?t=10156
There are multiple posts out there on how to change the font color of individual words. For example, see this one to change the font color:
https://stackoverflow.com/questions/433 ... batch-file
To change font color with terminal escape sequences (Requires Windows 10 and later):
Terminal Escape Sequences:
https://learn.microsoft.com/en-us/windo ... -sequences
viewtopic.php?t=10156
There are multiple posts out there on how to change the font color of individual words. For example, see this one to change the font color:
https://stackoverflow.com/questions/433 ... batch-file
To change font color with terminal escape sequences (Requires Windows 10 and later):
Code: Select all
REM Set an escape character
for /f %%e in ('echo prompt $E^|cmd') do set "\e=%%e"
set "redCol=%\e%[91m"
set "norCol=%\e%[97m"
echo This is %redCol%red. %norCol%This is not.
https://learn.microsoft.com/en-us/windo ... -sequences