roteme has asked for the wisdom of the Perl Monks concerning the following question:


Hi,
My Perl program run on cmd.exe.
How can I permanently change the size of the cmd.exe windows from my Perl program during the execution of the script so that the output is displayed in an orderly manner?
Needed size (e.g.): # Screen Buffer --> 120x300 # Window Size --> 120x25

Please advice
Thanks

Replies are listed 'Best First'.
Re: How can I increase the cmd.exe screen size permanently - by Perly
by bms (Monk) on Mar 25, 2012 at 16:08 UTC

    While I'm not sure if you can do this is Perl, I do know that you can set the default size of the command prompt to be bigger. Just right click on the title bar, click Properties, click the Layout tab, and change the Buffer and Window sizes to meet your needs.

Re: How can I increase the cmd.exe screen size permanently - by Perly
by BrowserUk (Patriarch) on Mar 26, 2012 at 12:59 UTC

    From within Perl you can do:

    perl -e"system q[mode con cols=100 lines=60];"

    Of course, you can issue the command from the command line or a batch file also.

    See help mode


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      Mode command was very useful for me – the problem is that it making my scroll-up bar to disappear!

      I need to print long usage for the user and the maximum size of the cmd.exe is not enough – I need buffer size , How can I set the Buffer size separately?

      I run the command:

      system q[mode con cols=100 lines=60];

      but the buffer size diapered.

      Even if I try to use Win32::Console I didn't success to resize the current cmd.exe include buffer size that enable me to print all my long usage.

      Can someone give me an example how to use Win32::Console to increase and leave the current cmd.exe display size to 100 * 60, or how to use mode and define a buffer size.

      Thanks

        Have you heard of the more command? Try typing help more

        Messing with the user's screen in order to display your long usage message is a bad idea.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

      Thanks, it help me a lot.
Re: How can I increase the cmd.exe screen size permanently - by Perly
by Anonymous Monk on Mar 25, 2012 at 16:19 UTC
      I can re size the screen with Win32::Console but only temporarily using sleep command and not regularly

        I can re size the screen with Win32::Console but only temporarily using sleep command and not regularly

        I don't know what you mean by that. When I resize the window using Win32::Console, the window stays resized.