How can I maximize a specific window through cmd? (Windows)

41,514

Solution 1

If you want to maximize an already-running program/window you can try with windowMode.bat using its title (or a string that the title starts with):

@echo off
call windowMode -title "Notepad" -mode maximized

Or with its process id:

@echo off
call windowMode -pid 1313 -mode maximized

Solution 2

Start takes an argument to do that.

START /MAX notepad.exe

However, if it is an already-running instance, it is outside of cmd's control.

Share:
41,514
Bruno Charters
Author by

Bruno Charters

Updated on June 06, 2020

Comments

  • Bruno Charters
    Bruno Charters almost 4 years

    I just want to make a simple Notepad .bat file that would maximize a specific process window. Is that possible?

  • Hubro
    Hubro about 10 years
    Nice! I needed a BAT script to start a process (a shell) in a maximized CMD. This did the trick: START /MAX cmd.exe /C "mode con cols=500 lines=500 && bin/my_shell.exe"
  • philippeback
    philippeback about 4 years
    Thanks for this, saves the day when IntelliJ stays in a minimized state with no way to get it to behave like it should. Cool idea to have a batch with code and invoking csc on it to do advanced magic.
  • Anshuman Chatterjee
    Anshuman Chatterjee almost 4 years
    This should have been the answer as the OP asked about maximizing any process