#1 18 Dec 2012 00:03

carlos
Member
From: Chile
Registered: 04 Nov 2008
Posts: 232
Website

More info about TITLE command

Hello. I check that the max length of the TITLE command is 259 characters. More characters than it causes a print of error message.

Test code:

@TITLE AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ

Last edited by carlos (18 Dec 2012 00:03)

Offline

#2 18 Dec 2012 10:14

bluesxman
Member
From: UK
Registered: 29 Dec 2006
Posts: 939

Re: More info about TITLE command

I make it 258 (on WinXP) using the following code:

@echo off

setlocal enabledelayedexpansion
set "title="
set "count=0"
for /l %%a in (0,1,26) do (
for %%b in (1 2 3 4 5 6 7 8 9 .) do (
title !title! || (set count & set title & pause & exit)
set "title=!title!%%b"
set /a count+=1
)
)

Either way, it's a slightly odd number as I'd have expected a 2ⁿ or (2ⁿ)-1 value.


cmd | *sh  | KiX | AutoIT3 | PowerShell | Puppet

Offline

#3 18 Dec 2012 12:02

AiroNG
Member
From: Germany
Registered: 26 Nov 2012
Posts: 39

Re: More info about TITLE command

243 is the limit on my windows 7 machine, while on my virtual xp i got the same result as bluesxman.

It's not that i would ever need the title to have an awful amount of characters in it, but does anyone know the reason for the limitation?


I don't suffer from insanity, I enjoy every minute of it.

Offline

#4 18 Dec 2012 13:28

npocmaka
Member
From: Bulgaria
Registered: 03 Dec 2009
Posts: 331

Re: More info about TITLE command

this made me wonder if there's a  limitation for PROMPT command.On my win7 machine it seems to be 400 symbols- but $G,$P,$T ... are taken as a single symbols.

Last edited by npocmaka (18 Dec 2012 13:47)


http://www.facebook.com/npocmaka

Offline

#5 18 Dec 2012 15:57

dbenham
Member
From: U.S. east coast
Registered: 15 Apr 2012
Posts: 100

Re: More info about TITLE command

AiroNG wrote:

243 is the limit on my windows 7 machine, while on my virtual xp i got the same result as bluesxman.

It's not that i would ever need the title to have an awful amount of characters in it, but does anyone know the reason for the limitation?

Haven't a clue why. On my Windows 7 machine the limit is 259, as reported by Carlos.

So there are two related mysteries - why the odd limit? and why does the limit vary, even within the same OS?


npocmaka wrote:

this made me wonder if there's a  limitation for PROMPT command.On my win7 machine it seems to be 400 symbols- but $G,$P,$T ... are taken as a single symbols.

Again, haven't a clue about the limit. But it makes sense $G, $P, $T are treated as single bytes, since that is what they represent. I suspect that $H is 3 bytes because it represents <backspace><space><backspace>.


Dave Benham

Offline

#6 18 Dec 2012 16:21

RG
Member
From: Minnesota
Registered: 18 Feb 2010
Posts: 321

Re: More info about TITLE command

Depends on what else you have in the title bar.  For example:
Using bluesxman's code On my Vista, Windows 7, Windows 8, 2008 Server, and 2012 Server machines I get a count of 259.
If I 'Run as administrator' on the same machines I get a count of 243.
This is because "Administrator: " appears in the title bar.  So obviously this would vary depending on language.
On XP SP3 I get 258.

Last edited by RG (18 Dec 2012 20:27)


CMD and InstallShield

Offline

Board footer

Powered by FluxBB