Hello,
I wrote a trivial program to set the console title in a console
application. Here is the code:-
namespace myns
{
class SetTitle
{
static void Main ( string [] args )
{
if ( 0 >= args.Length || 0 >= args [ 0 ].Length )
System.Console.WriteLine ( System.Console.Title );
string title = args [ 0 ];
if ( title.StartsWith ( @""" ) )
title = title.Substring ( 1 );
if ( title.EndsWith ( @""" ) )
title = title.Substring ( 0, title.Length - 1 );
System.Console.Title = title;
}
}
}
However, when executing from the command line (ran cmd.exe and switched
to output dir), the shell title does not change.
On the other hand, if I step through the program in Visual Studio, the
console popped up by Visual Studio does have its title changed.
Any ideas on this?
thanks,
-vijai.