Batch file 如何从批处理文件更改字体大小?
我的批处理文件如下所示:Batch file 如何从批处理文件更改字体大小?,batch-file,cmd,Batch File,Cmd,我的批处理文件如下所示: @echo off cls echo Hello Everyone pause > nul exit 现在我想让这个大家好使用特定的字体大小。有谁能帮助我如何使用批处理命令而不是更改CMD属性来实现这一点。我希望这能有所帮助,只需确保我在下面编写的代码的顶部在那里,并且没有被删除: @echo off setlocal enabledelayedexpansion enableextensions set "cmd.con=HKCU\Console\%
@echo off
cls
echo Hello Everyone
pause > nul
exit
现在我想让这个
大家好
使用特定的字体大小。有谁能帮助我如何使用批处理命令而不是更改CMD属性来实现这一点。我希望这能有所帮助,只需确保我在下面编写的代码的顶部在那里,并且没有被删除:
@echo off
setlocal enabledelayedexpansion enableextensions
set "cmd.con=HKCU\Console\%%SystemRoot%%_system32_cmd.exe /v"
set "ram=!tmp!\WRAM.tmp"
del "%tmp%\_$xy.bat">nul 2>&1
if [%1]==[ok] goto:init
Reg export HKCU\Console Backup.reg>nul
Reg delete HKCU\Console\%%SystemRoot%%_system32_cmd.exe /f>nul
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
)
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
)
rem Enter all of the code you want to output with the formatting, now all the text to be outputted from this batch file will be of the same font, but not the default terminal settings one.
cls
echo Hello Everyone
pause > nul
exit
最简单的解决方案是将批处理文件与快捷方式文件(.lnk文件)一起发布它运行批处理文件,并在快捷方式属性中包含希望用于控制台窗口的字体和字体大小,控制台窗口在启动
cmd.exe
时由explorer.exe
打开,以通过此快捷方式文件处理批处理文件。