in reply to How can I increase the cmd.exe screen size permanently - by Perly

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?

Replies are listed 'Best First'.
Re^2: How can I increase the cmd.exe screen size permanently - by Perly
by roteme (Acolyte) on Apr 02, 2012 at 07:16 UTC

    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?

        Sorry to nag - but I run the following code:

        use strict; use warnings; use Win32::Console; my $OUT = Win32::Console->new(STD_OUTPUT_HANDLE); my $IN = Win32::Console->new(STD_INPUT_HANDLE); $IN->Mode(ENABLE_MOUSE_INPUT|ENABLE_WINDOW_INPUT); $OUT->Size(180, 200); my ($maxx, $maxy) = $OUT->MaxWindow; $OUT->Cls; $OUT->Cursor(-1, -1, -1, 0); $OUT->FillAttr($BG_YELLOW|$FG_BLUE, $maxy * $maxx, 0, 0); $OUT->FillChar('X', $maxy*$maxx, 0, 0); $OUT->Window(1, 0, 0, $maxx, $maxy); while ($maxx>1 and $maxy>1) { $maxx -= 5; $maxy -= 5; $OUT->Window(1, 0, 0, $maxx, $maxy); sleep 1; } $OUT->Window(1, 0, 80, 50); $OUT->Cls;

        Indeed, the screen size is dynamically variable - but if I remove/mark the sleep command than I can't see the screen resize.

        I Would love to know what I was doing wrong, how can I make my current screen resize to 80*100 and stay on this size?

        Mode command I used is good indeed, the only problem is that it disappear the buffer size and the user can't scroll the screen up and down

        Thanks.

Re^2: How can I increase the cmd.exe screen size permanently - by Perly
by roteme (Acolyte) on Mar 28, 2012 at 11:37 UTC
    Thanks, it help me a lot.