Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 如何从批处理文件更改字体大小?_Batch File_Cmd - Fatal编程技术网

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
打开,以通过此快捷方式文件处理批处理文件。