Wow. The snarkiness is flying today! And yet no one has the answer! Kuh-ching!

First, an explanation of why your approach doesn't work. When you run system from Perl, you are running a new shell, which is to say a new copy of CMD.exe, which has its own environment. You type title <something> and it works, but as soon as the new shell exits, you're back in the parent shell, which never had its title changed. You have to do it from inside, via the Win32 API.

use Win32::Console; my $CONSOLE=Win32::Console->new; $CONSOLE->Title('This is a new title - Huzzah!');

That will change the title for the duration of your script. When the script ends, the title will revert to what it was before you ran the script. You can change the title as much as you want.

Cheers!

--marmot

In reply to Re: Changing the title of the command window on which the perl exe is run by furry_marmot
in thread Changing the title of the command window on which the perl exe is run by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.