Windows 11: starting one and *only* one program in a smaller-than-default window?

Hippo Man 0 Reputation points
2024-08-27T22:52:02.41+00:00

I'm running Windows 11. I have set my default Windows Terminal size to 80x32, and I use this default terminal size for the launched windows for almost all programs that I invoke.

However, I have one and only one case where I want to launch a command in a smaller window: 40x10.

Given that in their infinite wisdom (ha ha!), Microsoft started disallowing distinct terminal window sizes per profile for Windows Terminal, how can I create a shortcut that will launch this one and only command in the smaller 40x10 window, while continuing to use the default 80x32 size for all other terminal windows that get launched?

And I don't want to have to use C# to do this. I'd like to use a Windows 11 utility such as Terminal, Conhost, etc. in order to allow this to occur.

Is there any way to accomplish this short of reverting to an older version of Windows?

Thank you very much in advance.

UPDATE: the command I want to launch in the small window is simply some code in a PowerShell script which writes its output to the terminal.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,467 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 36,336 Reputation points Microsoft Vendor
    2024-08-30T01:26:08.0266667+00:00

    Hi Hippo,

    Thanks for your post. You can try the following method to open the window with 40x10.

    1. Create the .bat file with following lines.

    @echo off

    mode con: cols=40 lines=10

    cmd

    1. Save as in the desktop and click it directly when you want to open the specific window next time.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  2. Hippo Man 0 Reputation points
    2024-08-31T00:09:23.5633333+00:00

    Thank you, but when I follow the above instructions, the "cmd" window still opens up full size.

    It seems like the "mode con: cols=40 lines=10" directive is ignored.

    I looked up "mode con" on line, and it seems that other people are reporting that it works properly under "Windows 10", but not under "Windows 11".

    Is there an alternative way to do this under Windows 11?


  3. Hippo Man 0 Reputation points
    2024-08-31T00:10:45.75+00:00

    Oops! I'm sorry, but I accidentally posted a second copy of the above response. There is no "delete" option, so I'm just rewriting this here to explain what happened.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.