#1 01 Aug 2015 00:16

New Member
Registered: 01 Aug 2015
Posts: 1

Get the number of columns CMD.exe

Hello everyone!
For a long time I searched for a way to get the number of CMD.exe columns. Now I found I share with you:

@echo off

for /f "tokens=1,2" %%a in ('mode con ^| findstr /i .Colunas.') do (set CONSOLE_COLUMNS=%%b)

echo O número de colunas desta janela é %CONSOLE_COLUMNS%

The code is in Portuguese. To change to another language, simply change the word "Column" for the equivalent in the desired language, according to the command displayed by mode con


Board footer

Powered by FluxBB