Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 775
Bruno Charters Avatar asked Feb 07 '13 20:02

Bruno Charters


People also ask

How do I maximize a Command Prompt window?

Open the Command Prompt and press Alt + ↵ Enter to make it full-screen.

How do I batch resize a window?

If you just open the batch file, click on the window, and then click "properties", and then to "layout", and scroll down to "Window Size", you can edit it from there. It will also stay that way every time you open that specific batch file, so it's pretty handy.


2 Answers

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
like image 122
npocmaka Avatar answered Oct 09 '22 08:10

npocmaka


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.

like image 22
Anirudh Ramanathan Avatar answered Oct 09 '22 09:10

Anirudh Ramanathan